src/Event.php
public static function on($class, $name, callable $handler)
    {
        $class = ObjectHelper::getClass($class);
        if (!isset(static::$events[$class][$name])) {
            static::$events[$class][$name] = [];
        }
        static::$events[$class][$name][] = $handler;
    }
public static function on($class, $name, callable $handler)
    {
        $class = ObjectHelper::getClass($class);
        if (!isset(static::$events[$class][$name])) {
            static::$events[$class][$name] = [];
        }
        static::$events[$class][$name][] = $handler;
    }
public static function on ( $ class , $ name , callable $ handler ) { $ class = ObjectHelper :: getClass ( $ class ) ; if ( ! isset ( static :: $ events [ $ class ] [ $ name ] ) ) { static :: $ events [ $ class ] [ $ name ] = [ ] ; } static :: $ events [ $ class ] [ $ name ] [ ] = $ handler ; }
Subscribing in event.

@param string|object $class the fully qualified class name to which the event handler needs to attach.
@param string         $name          name of event
@param callable $handler       handler

- `function (Event $event) { ... }`
- `[new Foo, 'method']`
- `['Foo', 'static_method']`
Subscribing in event .