src/EventDispatcher.php
public static function addListener($action, $callback)
    {
        // Make sure it's something callable
        if (!is_callable($callback) && !is_array($callback)) {
            throw new Exception("Invalid callback for [{$action}]");
        }

        if (!isset(static::$listeners[$action])) {
            static::$listeners[$action] = [];
        }

        static::$listeners[$action][] = $callback;
    }
public static function addListener($action, $callback)
    {
        // Make sure it's something callable
        if (!is_callable($callback) && !is_array($callback)) {
            throw new Exception("Invalid callback for [{$action}]");
        }

        if (!isset(static::$listeners[$action])) {
            static::$listeners[$action] = [];
        }

        static::$listeners[$action][] = $callback;
    }
public static function addListener ( $ action , $ callback ) { // Make sure it's something callable if ( ! is_callable ( $ callback ) && ! is_array ( $ callback ) ) { throw new Exception ( "Invalid callback for [{$action}]" ) ; } if ( ! isset ( static :: $ listeners [ $ action ] ) ) { static :: $ listeners [ $ action ] = [ ] ; } static :: $ listeners [ $ action ] [ ] = $ callback ; }
Add a listener to the action.

@param string         $action
@param array|callable $callback
Add a listener to the action .