Skip to content

Commit

Permalink
compatibility update of Dispatcher with EventDispatcherInterface from…
Browse files Browse the repository at this point in the history
… Symfony7
  • Loading branch information
prwnr committed Jan 29, 2024
1 parent 38d2568 commit 214fac1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Event/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@ public function dispatch(object $event, string $eventName = null): object
/**
* {@inheritdoc}
*/
public function addListener(string $eventName, $listener, int $priority = 0)
public function addListener(string $eventName, callable $listener, int $priority = 0): void
{
throw new \Exception('Please use `Event::listen()`.');
}

/**
* {@inheritdoc}
*/
public function addSubscriber(EventSubscriberInterface $subscriber)
public function addSubscriber(EventSubscriberInterface $subscriber): void
{
throw new \Exception('Please use `Event::subscribe()`.');
}

/**
* {@inheritdoc}
*/
public function removeListener(string $eventName, $listener)
public function removeListener(string $eventName, callable $listener): void
{
throw new \Exception('Please use `Event::forget()`.');
}

/**
* {@inheritdoc}
*/
public function removeSubscriber(EventSubscriberInterface $subscriber)
public function removeSubscriber(EventSubscriberInterface $subscriber): void
{
throw new \Exception('Removing event subscribers is not supported');
}
Expand Down

0 comments on commit 214fac1

Please sign in to comment.