Skip to content

Commit

Permalink
Respect parent class contract in ContainerAwareDoctrineEventManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Koc committed May 6, 2019
1 parent f16e9a5 commit 43205af
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php
Expand Up @@ -29,13 +29,6 @@ class ContainerAwareEventManager extends EventManager
*/
private $listeners = [];

/**
* Map of initialized listener hash per listener service id.
*
* <service_name> => <object_hash>
*/
private $initializedHashes = [];

private $initialized = [];

private $container;
Expand Down Expand Up @@ -146,10 +139,6 @@ public function removeEventListener($events, $listener)
{
if (\is_string($listener)) {
$hash = '_service_'.$listener;
// Service already initialized
if (isset($this->initializedHashes[$hash])) {
$hash = $this->initializedHashes[$hash];
}
} else {
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
Expand All @@ -170,9 +159,7 @@ private function initializeListeners($eventName)
{
foreach ($this->listeners[$eventName] as $hash => $listener) {
if (\is_string($listener)) {
$listener = $this->container->get($listener);
$this->listeners[$eventName][$hash] = $listener;
$this->initializedHashes[$hash] = spl_object_hash($listener);
$this->listeners[$eventName][$hash] = $this->container->get($listener);
}
}
$this->initialized[$eventName] = true;
Expand Down

0 comments on commit 43205af

Please sign in to comment.