10000 Respect parent class contract in ContainerAwareDoctrineEventManager · symfony/symfony@43205af · GitHub
[go: up one dir, main page]

Skip to content

Commit 43205af

Browse files
committed
Respect parent class contract in ContainerAwareDoctrineEventManager
1 parent f16e9a5 commit 43205af

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ class ContainerAwareEventManager extends EventManager
2929
*/
3030
private $listeners = [];
3131

32-
/**
33-
* Map of initialized listener hash per listener service id.
34-
*
35-
* <service_name> => <object_hash>
36-
*/
37-
private $initializedHashes = [];
38-
3932
private $initialized = [];
4033

4134
private $container;
@@ -146,10 +139,6 @@ public function removeEventListener($events, $listener)
146139
{
147140
if (\is_string($listener)) {
148141
$hash = '_service_'.$listener;
149-
// Service already initialized
150-
if (isset($this->initializedHashes[$hash])) {
151-
$hash = $this->initializedHashes[$hash];
152-
}
153142
} else {
154143
// Picks the hash code related to that listener
155144
$hash = spl_object_hash($listener);
@@ -170,9 +159,7 @@ private function initializeListeners($eventName)
170159
{
171160
foreach ($this->listeners[$eventName] as $hash => $listener) {
172161
if (\is_string($listener)) {
173-
$listener = $this->container->get($listener);
174-
$this->listeners[$eventName][$hash] = $listener;
175-
$this->initializedHashes[$hash] = spl_object_hash($listener);
162+
$this->listeners[$eventName][$hash] = $this->container->get($listener);
176163
}
177164
}
178165
$this->initialized[$eventName] = true;

0 commit comments

Comments
 (0)
0