egulias/listeners-debug

Debug library for listeners registered in the Symfony 2 DIC

Installs: 56 009

Dependents: 1

Stars: 3

Watchers: 1

Forks: 1

Open Issues: 1

Language: PHP

1.0.2 2014-06-08 17:55 UTC

README

This library will fetch information about all the listeners tagged with .event_listener inside the DIC

Installation and configuration

Get the lib

php composer.phar require egulias/listeners-debug

Use

Basic usage

<?php

use Egulias\ListenersDebug\ListenerFetcher;

$fetcher = new ListenerFetcher($containerBuilder);

$listeners = $fetcher->fetchListeners($showPrivate);
$listener = $fetcher->fetchListener($listenerServiceId);

Filtering

<?php

use Egulias\ListenersDebug\ListenerFetcher;
use Egulias\ListenersDebug\ListenerFilter;

$fetcher = new ListenerFetcher($containerBuilder);
$filter = new ListenerFilter();

$listeners = $fetcher->fetchListeners($showPrivate);

$filteredAndOrdered = $filter->filterByEvent($eventName, $listeners, $orderByPriorityAsc);

Contributors

The initial contributors to the foundations of this library can be found here in the bundle history.