src/Viserio/Component/Events/DataCollector/ViserioEventsDataCollector.php
public function getPanel(): string
    {
        $calledContent = $notCalledContent = '';
        $called        = $notCalled        = [];

        $tableConfig = static function (string $name, string $emptyText): array {
            return ['name' => $name, 'headers' => ['Priority', 'Listener'], 'vardumper' => false, 'empty_text' => $emptyText];
        };

        foreach ($this->data['called_listeners'] as $eventName => $calledListener) {
            foreach ($calledListener as $listner) {
                $called[] = [$listner['priority'], $listner['pretty']];
            }

            $calledContent .= $this->createTable($called, $tableConfig($eventName, 'No events have been recorded. Check that debugging is enabled in the kernel.'));
        }

        foreach ($this->data['not_called_listeners'] as $eventName => $calledListener) {
            foreach ($calledListener as $listner) {
                $notCalled[] = [$listner['priority'], $listner['pretty']];
            }

            $notCalledContent .= $this->createTable(
                $notCalled,
                $tableConfig(
                    $eventName,
                    '<p><strong>There are no uncalled listeners.</strong></p>' .
                    '<p>All listeners were called for this request or an error occurred when trying to collect uncalled listeners' .
                    '(in which case check the logs to get more information).</p>'
                )
            );
        }

        $orphanedEventsContent = $this->createTable(
            $this->data['orphaned_events'],
            [
                'headers'    => ['events'],
                'vardumper'  => false,
                'empty_text' => '<p><strong>There are no orphaned events.</strong></p>' .
                    '<p>All dispatched events were handled or an error occurred when trying to collect orphaned events' .
                    '(in which case check the logs to get more information).</p>',
            ]
        );

        return $this->createTabs([
            [
                'name'    => 'Called Listeners <span class="counter">' . \count($called) . '</span>',
                'content' => $calledContent,
            ],
            [
                'name'    => 'Not Called Listeners <span class="counter">' . \count($notCalled) . '</span>',
                'content' => $notCalledContent,
            ],
            [
                'name'    => 'Orphaned events <span class="counter">' . \count($this->data['orphaned_events']) . '</span>',
                'content' => $orphanedEventsContent,
            ],
        ]);
    }
public function getPanel(): string
    {
        $calledContent = $notCalledContent = '';
        $called        = $notCalled        = [];

        $tableConfig = static function (string $name, string $emptyText): array {
            return ['name' => $name, 'headers' => ['Priority', 'Listener'], 'vardumper' => false, 'empty_text' => $emptyText];
        };

        foreach ($this->data['called_listeners'] as $eventName => $calledListener) {
            foreach ($calledListener as $listner) {
                $called[] = [$listner['priority'], $listner['pretty']];
            }

            $calledContent .= $this->createTable($called, $tableConfig($eventName, 'No events have been recorded. Check that debugging is enabled in the kernel.'));
        }

        foreach ($this->data['not_called_listeners'] as $eventName => $calledListener) {
            foreach ($calledListener as $listner) {
                $notCalled[] = [$listner['priority'], $listner['pretty']];
            }

            $notCalledContent .= $this->createTable(
                $notCalled,
                $tableConfig(
                    $eventName,
                    '<p><strong>There are no uncalled listeners.</strong></p>' .
                    '<p>All listeners were called for this request or an error occurred when trying to collect uncalled listeners' .
                    '(in which case check the logs to get more information).</p>'
                )
            );
        }

        $orphanedEventsContent = $this->createTable(
            $this->data['orphaned_events'],
            [
                'headers'    => ['events'],
                'vardumper'  => false,
                'empty_text' => '<p><strong>There are no orphaned events.</strong></p>' .
                    '<p>All dispatched events were handled or an error occurred when trying to collect orphaned events' .
                    '(in which case check the logs to get more information).</p>',
            ]
        );

        return $this->createTabs([
            [
                'name'    => 'Called Listeners <span class="counter">' . \count($called) . '</span>',
                'content' => $calledContent,
            ],
            [
                'name'    => 'Not Called Listeners <span class="counter">' . \count($notCalled) . '</span>',
                'content' => $notCalledContent,
            ],
            [
                'name'    => 'Orphaned events <span class="counter">' . \count($this->data['orphaned_events']) . '</span>',
                'content' => $orphanedEventsContent,
            ],
        ]);
    }
{@inheritdoc}