Skip to content

Commit

Permalink
[FrameworkBundle] Removed EventSubscriber support for DI tags because…
Browse files Browse the repository at this point in the history
… it currently cannot be implemented
  • Loading branch information
Bernhard Schussek committed Mar 17, 2011
1 parent 932f3b1 commit de57480
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
Expand Up @@ -68,24 +68,6 @@ public function addEventListenerService($events, $serviceId, $priority = 0)
}
}

/**
* Adds a service as event subscriber
*
* @param string $serviceId The ID of the subscriber service
* @param integer $priority The higher this value, the earlier an event
* listener will be triggered in the chain.
* Defaults to 0.
*/
public function addEventSuscriberService($serviceId, $priority = 0)
{
if (!is_string($serviceId)) {
throw new \InvalidArgumentException('Expected a string argument');
}

// TODO get class name, call static method getSubscribedEvents()
// and pass to addEventListenerService
}

/**
* {@inheritDoc}
*
Expand Down
Expand Up @@ -31,10 +31,10 @@ public function process(ContainerBuilder $container)
$priority = isset($event['priority']) ? $event['priority'] : 0;

if (!isset($event['event'])) {
$definition->addMethodCall('addEventSubscriberService', array($id, $priority));
} else {
$definition->addMethodCall('addEventListenerService', array($event['event'], $id, $priority));
throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.listener" tags.', $id));
}

$definition->addMethodCall('addEventListenerService', array($event['event'], $id, $priority));
}
}
}
Expand Down

0 comments on commit de57480

Please sign in to comment.