public function on(string $event, callable $handler, $once = false): void
    {
        if (self::isSupportedEvent($event)) {
            self::$eventHandlers[$event][] = $handler;

            if (!isset(self::$events[$event])) {
                self::$events[$event] = (bool)$once;
            }
        }
    }
public function on(string $event, callable $handler, $once = false): void
    {
        if (self::isSupportedEvent($event)) {
            self::$eventHandlers[$event][] = $handler;

            if (!isset(self::$events[$event])) {
                self::$events[$event] = (bool)$once;
            }
        }
    }
public function on ( string $ event , callable $ handler , $ once = false ) : void { if ( self :: isSupportedEvent ( $ event ) ) { self :: $ eventHandlers [ $ event ] [ ] = $ handler ; if ( ! isset ( self :: $ events [ $ event ] ) ) { self :: $ events [ $ event ] = ( bool ) $ once ; } } }
register a event handler
@param          $event
@param callable $handler
@param bool     $once
register a event handler