public function trigger($name, ...$args)
    {
        //we should deal with strings
        //then callables respectively
        //to allow overriding
        if (is_string($name)) {
            //is it a protocol?
            if (strpos($name, '://') !== false) {
                return $this->triggerProtocol($name, ...$args);
            }

            //they can call a class
            if (strpos($name, '@') !== false) {
                return $this->triggerController($name, ...$args);
            }

            //unless it's a static call
            if (strpos($name, '::') !== false && is_callable($name)) {
                call_user_func_array($name, $args);
                return $this;
            }

            return $this->triggerEvent($name, ...$args);
        }

        if (is_callable($name)) {
            if ($name instanceof Closure) {
                $name = $this->bindCallback($name);
            }

            call_user_func_array($name, $args);
        }

        //we can only deal with callable and strings
        //we don't want to throw an error
        //because it could just be a pseudo
        //placeholder
        return $this;
    }
public function trigger($name, ...$args)
    {
        //we should deal with strings
        //then callables respectively
        //to allow overriding
        if (is_string($name)) {
            //is it a protocol?
            if (strpos($name, '://') !== false) {
                return $this->triggerProtocol($name, ...$args);
            }

            //they can call a class
            if (strpos($name, '@') !== false) {
                return $this->triggerController($name, ...$args);
            }

            //unless it's a static call
            if (strpos($name, '::') !== false && is_callable($name)) {
                call_user_func_array($name, $args);
                return $this;
            }

            return $this->triggerEvent($name, ...$args);
        }

        if (is_callable($name)) {
            if ($name instanceof Closure) {
                $name = $this->bindCallback($name);
            }

            call_user_func_array($name, $args);
        }

        //we can only deal with callable and strings
        //we don't want to throw an error
        //because it could just be a pseudo
        //placeholder
        return $this;
    }
public function trigger ( $ name , ... $ args ) { //we should deal with strings //then callables respectively //to allow overriding if ( is_string ( $ name ) ) { //is it a protocol? if ( strpos ( $ name , '://' ) !== false ) { return $ this -> triggerProtocol ( $ name , ... $ args ) ; } //they can call a class if ( strpos ( $ name , '@' ) !== false ) { return $ this -> triggerController ( $ name , ... $ args ) ; } //unless it's a static call if ( strpos ( $ name , '::' ) !== false && is_callable ( $ name ) ) { call_user_func_array ( $ name , $ args ) ; return $ this ; } return $ this -> triggerEvent ( $ name , ... $ args ) ; } if ( is_callable ( $ name ) ) { if ( $ name instanceof Closure ) { $ name = $ this -> bindCallback ( $ name ) ; } call_user_func_array ( $ name , $ args ) ; } //we can only deal with callable and strings //we don't want to throw an error //because it could just be a pseudo //placeholder return $ this ; }
Calls an event considering classes and protocols

@param *string|callable $name
@param mixed            ...$args

@return PipeTrait
Calls an event considering classes and protocols