protected function newBusListener($sourcePattern, $targetEventName)
    {
        return function () use ($targetEventName, $sourcePattern) {

            $args = func_get_args();
            $originalEventName = array_shift($args);

            // We do the wildcard matching by ourselfs here...
            if (!$this->matchesPattern($originalEventName, $sourcePattern)) {
                return null;
            }


            $targetEventName = $this->buildTargetEventName($originalEventName, $targetEventName);

            return $this->target->fire($targetEventName, $args);
        };
    }
protected function newBusListener($sourcePattern, $targetEventName)
    {
        return function () use ($targetEventName, $sourcePattern) {

            $args = func_get_args();
            $originalEventName = array_shift($args);

            // We do the wildcard matching by ourselfs here...
            if (!$this->matchesPattern($originalEventName, $sourcePattern)) {
                return null;
            }


            $targetEventName = $this->buildTargetEventName($originalEventName, $targetEventName);

            return $this->target->fire($targetEventName, $args);
        };
    }
protected function newBusListener ( $ sourcePattern , $ targetEventName ) { return function ( ) use ( $ targetEventName , $ sourcePattern ) { $ args = func_get_args ( ) ; $ originalEventName = array_shift ( $ args ) ; // We do the wildcard matching by ourselfs here... if ( ! $ this -> matchesPattern ( $ originalEventName , $ sourcePattern ) ) { return null ; } $ targetEventName = $ this -> buildTargetEventName ( $ originalEventName , $ targetEventName ) ; return $ this -> target -> fire ( $ targetEventName , $ args ) ; } ; }
Creates a listener for a bus.

@param string $sourcePattern
@param string $targetEventName

@return Closure
Creates a listener for a bus .