class WrappedListener in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/event-dispatcher/Debug/WrappedListener.php \Symfony\Component\EventDispatcher\Debug\WrappedListener
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\EventDispatcher\Debug\WrappedListener
Expanded class hierarchy of WrappedListener
File
- vendor/
symfony/ event-dispatcher/ Debug/ WrappedListener.php, line 21
Namespace
Symfony\Component\EventDispatcher\DebugView source
class WrappedListener {
private $listener;
private $name;
private $called;
private $stoppedPropagation;
private $stopwatch;
private $dispatcher;
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) {
$this->listener = $listener;
$this->name = $name;
$this->stopwatch = $stopwatch;
$this->dispatcher = $dispatcher;
$this->called = false;
$this->stoppedPropagation = false;
}
public function getWrappedListener() {
return $this->listener;
}
public function wasCalled() {
return $this->called;
}
public function stoppedPropagation() {
return $this->stoppedPropagation;
}
public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher) {
$this->called = true;
$e = $this->stopwatch
->start($this->name, 'event_listener');
call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher);
if ($e
->isStarted()) {
$e
->stop();
}
if ($event
->isPropagationStopped()) {
$this->stoppedPropagation = true;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
WrappedListener:: |
private | property | ||
WrappedListener:: |
private | property | ||
WrappedListener:: |
private | property | ||
WrappedListener:: |
private | property | ||
WrappedListener:: |
private | property | ||
WrappedListener:: |
private | property | ||
WrappedListener:: |
public | function | ||
WrappedListener:: |
public | function | ||
WrappedListener:: |
public | function | ||
WrappedListener:: |
public | function | ||
WrappedListener:: |
public | function |