src/Kisma/Core/Utility/EventManager.php
public static function discoverListeners( $object, $listeners = null, $pattern = self::LISTENER_DISCOVERY_PATTERN )
    {
        //	Allow for passed in listeners
        $_listeners = $listeners ?: static::_discoverObjectListeners( $object, $pattern );

        //	And wire them up...
        if ( empty( $_listeners ) || !is_array( $_listeners ) )
        {
            return;
        }

        foreach ( $_listeners as $_eventName => $_callables )
        {
            foreach ( $_callables as $_listener )
            {
                static::on( $_eventName, $_listener );
            }
        }
    }
public static function discoverListeners( $object, $listeners = null, $pattern = self::LISTENER_DISCOVERY_PATTERN )
    {
        //	Allow for passed in listeners
        $_listeners = $listeners ?: static::_discoverObjectListeners( $object, $pattern );

        //	And wire them up...
        if ( empty( $_listeners ) || !is_array( $_listeners ) )
        {
            return;
        }

        foreach ( $_listeners as $_eventName => $_callables )
        {
            foreach ( $_callables as $_listener )
            {
                static::on( $_eventName, $_listener );
            }
        }
    }
public static function discoverListeners ( $ object , $ listeners = null , $ pattern = self :: LISTENER_DISCOVERY_PATTERN ) { //	Allow for passed in listeners $ _listeners = $ listeners ? : static :: _discoverObjectListeners ( $ object , $ pattern ) ; //	And wire them up... if ( empty ( $ _listeners ) || ! is_array ( $ _listeners ) ) { return ; } foreach ( $ _listeners as $ _eventName => $ _callables ) { foreach ( $ _callables as $ _listener ) { static :: on ( $ _eventName , $ _listener ) ; } } }
Wires up any event handlers automatically

@param \Kisma\Core\Interfaces\SubscriberLike|string $object    Object or class discovery target
@param array|null                                   $listeners Array of 'event.name' => callback/closure pairs
@param string                                       $pattern

@return void
Wires up any event handlers automatically