You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php
+4-13Lines changed: 4 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -66,13 +66,8 @@ public function dispatchEvent($eventName, EventArgs $eventArgs = null): void
66
66
/**
67
67
* @return object[][]
68
68
*/
69
-
publicfunctiongetListeners($event = null): array
69
+
publicfunctiongetListeners(string$event): array
70
70
{
71
-
if (null === $event) {
72
-
trigger_deprecation('symfony/doctrine-bridge', '6.2', 'Calling "%s()" without an event name is deprecated. Call "getAllListeners()" instead.', __METHOD__);
73
-
74
-
return$this->getAllListeners();
75
-
}
76
71
if (!$this->initializedSubscribers) {
77
72
$this->initializeSubscribers();
78
73
}
@@ -107,7 +102,7 @@ public function hasListeners($event): bool
@@ -188,12 +183,8 @@ private function initializeSubscribers(): void
188
183
$this->addEventListener(...$listener);
189
184
continue;
190
185
}
191
-
if (\is_string($listener)) {
192
-
$listener = $this->container->get($listener);
193
-
}
194
-
// throw new \InvalidArgumentException(sprintf('Using Doctrine subscriber "%s" is not allowed, declare it as a listener instead.', \is_object($listener) ? $listener::class : $listener));
195
-
trigger_deprecation('symfony/doctrine-bridge', '6.3', 'Using Doctrine subscribers as services is deprecated, declare listeners instead');
196
-
parent::addEventSubscriber($listener);
186
+
187
+
thrownew \InvalidArgumentException(sprintf('Using Doctrine subscriber "%s" is not allowed, declare it as a listener instead.', \is_object($listener) ? $listener::class : $listener));
$this->expectExceptionMessage('Using Doctrine subscriber "Symfony\Bridge\Doctrine\Tests\MySubscriber" is not allowed, declare it as a listener instead.');
49
+
$this->evm->getListeners('foo');
55
50
}
56
51
57
52
publicfunctiontestDispatchEvent()
@@ -81,40 +76,6 @@ public function testDispatchEvent()
$this->expectDeprecation('Since symfony/doctrine-bridge 6.2: Calling "Symfony\Bridge\Doctrine\ContainerAwareEventManager::getListeners()" without an event name is deprecated. Call "getAllListeners()" instead.');
0 commit comments