* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * This EventDispatcher implementation uses a DependencyInjection container to load listeners. * * @author Fabien Potencier */ class EventDispatcher extends BaseEventDispatcher { public function setContainer(ContainerInterface $container) { foreach ($container->findTaggedServiceIds('kernel.listener') as $id => $attributes) { $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; $container->get($id)->register($this, $priority); } } }