Skip to content

Commit 2fb9b9a

Browse files
Merge branch '5.2' into 5.3
* 5.2: Backport type fixes Fix CS Avoid triggering the autoloader in Deprecation::isLegacy() fix markdown markup Backport type fixes uzb translation [DependencyInjection] Fix doc blocks [DependencyInjection] Turn $defaultDeprecationTemplate into a constant [Form] better form doc types to support static analysis
2 parents 67a5f35 + 3f14a12 commit 2fb9b9a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

EventDispatcherInterface.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
2525
/**
2626
* Adds an event listener that listens on the specified events.
2727
*
28-
* @param callable $listener The listener
29-
* @param int $priority The higher this value, the earlier an event
30-
* listener will be triggered in the chain (defaults to 0)
28+
* @param int $priority The higher this value, the earlier an event
29+
* listener will be triggered in the chain (defaults to 0)
3130
*/
32-
public function addListener(string $eventName, $listener, int $priority = 0);
31+
public function addListener(string $eventName, callable $listener, int $priority = 0);
3332

3433
/**
3534
* Adds an event subscriber.
@@ -41,10 +40,8 @@ public function addSubscriber(EventSubscriberInterface $subscriber);
4140

4241
/**
4342
* Removes an event listener from the specified events.
44-
*
45-
* @param callable $listener The listener to remove
4643
*/
47-
public function removeListener(string $eventName, $listener);
44+
public function removeListener(string $eventName, callable $listener);
4845

4946
public function removeSubscriber(EventSubscriberInterface $subscriber);
5047

@@ -60,11 +57,9 @@ public function getListeners(string $eventName = null);
6057
*
6158
* Returns null if the event or the listener does not exist.
6259
*
63-
* @param callable $listener The listener
64-
*
6560
* @return int|null The event listener priority
6661
*/
67-
public function getListenerPriority(string $eventName, $listener);
62+
public function getListenerPriority(string $eventName, callable $listener);
6863

6964
/**
7065
* Checks whether an event has any registered listeners.

Tests/EventDispatcherTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ public function postFoo($e)
434434
$e->stopPropagation();
435435
}
436436
}
437+
438+
public function __invoke()
439+
{
440+
}
437441
}
438442

439443
class TestWithDispatcher

0 commit comments

Comments
 (0)