public function EventsDataCollector::lateCollect in Devel 4.x
Same name and namespace in other branches
- 8.3 webprofiler/src/DataCollector/EventsDataCollector.php \Drupal\webprofiler\DataCollector\EventsDataCollector::lateCollect()
- 8 webprofiler/src/DataCollector/EventsDataCollector.php \Drupal\webprofiler\DataCollector\EventsDataCollector::lateCollect()
- 8.2 webprofiler/src/DataCollector/EventsDataCollector.php \Drupal\webprofiler\DataCollector\EventsDataCollector::lateCollect()
File
- webprofiler/
src/ DataCollector/ EventsDataCollector.php, line 50
Class
- EventsDataCollector
- Class EventsDataCollector.
Namespace
Drupal\webprofiler\DataCollectorCode
public function lateCollect() {
if ($this->eventDispatcher instanceof EventDispatcherTraceableInterface) {
$countCalled = 0;
$calledListeners = $this->eventDispatcher
->getCalledListeners();
foreach ($calledListeners as &$events) {
foreach ($events as &$priority) {
foreach ($priority as &$listener) {
$countCalled++;
$listener['clazz'] = $this
->getMethodData($listener['class'], $listener['method']);
}
}
}
$countNotCalled = 0;
$notCalledListeners = $this->eventDispatcher
->getNotCalledListeners();
foreach ($notCalledListeners as $events) {
foreach ($events as $priority) {
foreach ($priority as $listener) {
$countNotCalled++;
}
}
}
$this->data = [
'called_listeners' => $calledListeners,
'called_listeners_count' => $countCalled,
'not_called_listeners' => $notCalledListeners,
'not_called_listeners_count' => $countNotCalled,
];
}
}