namespace Symfony\Component\EventDispatcher\Debug;
+use Psr\Log\LoggerInterface;
+use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Stopwatch\Stopwatch;
-use Psr\Log\LoggerInterface;
/**
* Collects some data about event listeners.
private $dispatcher;
private $wrappedListeners;
- /**
- * Constructor.
- *
- * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
- * @param Stopwatch $stopwatch A Stopwatch instance
- * @param LoggerInterface $logger A LoggerInterface instance
- */
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null)
{
$this->dispatcher = $dispatcher;
return $notCalled;
}
+ public function reset()
+ {
+ $this->called = array();
+ }
+
/**
* Proxies all method calls to the original event dispatcher.
*
*/
public function __call($method, $arguments)
{
- return call_user_func_array(array($this->dispatcher, $method), $arguments);
+ return \call_user_func_array(array($this->dispatcher, $method), $arguments);
}
/**
private function sortListenersByPriority($a, $b)
{
- if (is_int($a['priority']) && !is_int($b['priority'])) {
+ if (\is_int($a['priority']) && !\is_int($b['priority'])) {
return 1;
}
- if (!is_int($a['priority']) && is_int($b['priority'])) {
+ if (!\is_int($a['priority']) && \is_int($b['priority'])) {
return -1;
}