Skip to content

Event Collector

Captures PSR-14 dispatched events with timing, listener metadata, and source location.

Event Collector panel

What It Captures

FieldDescription
nameEvent class name
eventSerialized event object
fileSource file of the dispatch call
lineSource line of the dispatch call
timeTimestamp when the event was dispatched

Data Schema

json
[
    {
        "name": "App\\Event\\UserRegistered",
        "event": "object@App\\Event\\UserRegistered#12",
        "file": "/app/src/UserService.php",
        "line": "42",
        "time": 1711878000.456
    }
]

Summary (shown in debug entry list):

json
{
    "event": {
        "total": 8
    }
}

Contract

php
use AppDevPanel\Kernel\Collector\EventCollector;

$collector->collect(
    event: $event,     // The dispatched event object
    line: '/app/src/UserService.php:42',
);

How It Works

The collector is fed by EventDispatcherInterfaceProxyAppDevPanel\Kernel\Collector\EventDispatcherInterfaceProxyDecorator proxy for Event Dispatcher Interface. Intercepts calls and forwards data to collectors.final Kernel · class · implements EventDispatcherInterface — a PSR-14 EventDispatcherInterfacePsr\EventDispatcher\EventDispatcherInterfacePSR-14 Event Dispatcher Interface. Defines a dispatcher for events.PSR-14 · interface decorator. Every $dispatcher->dispatch($event) call is intercepted, timed, and forwarded to the collector.

Framework adapters register the proxy automatically.

Debug Panel

  • Event type badges — color-coded by event category (request, response, controller, etc.)
  • Chronological list — events shown in dispatch order with timestamps
  • Expandable details — click to view the full event object and listener chain
  • Event count — total events shown in sidebar badge

Released under the MIT License.