src/Pipeline/AbstractProcessor.php
protected function resolvePipe($pipe, $payload)
    {
        if ($pipe instanceof Closure) {
            // process pipe closure
            return call_user_func($pipe, $payload);
        } elseif ($pipe instanceof Pipeline) {
            // process another pipeline instance
            return $pipe->process($payload);
        } elseif (is_string($pipe) && class_exists($pipe)) {
            // process pipe class name
            return $this->processPipeClassName($pipe, $payload);
        } elseif (is_object($pipe)) {
            // process pipe object instance
            return $this->processPipeObject($pipe, $payload);
        } elseif (is_callable($pipe)) {
            // process callable pipe function
            return $pipe($payload);
        }

        // unknown pipe type
        throw new InvalidPipeException();
    }
protected function resolvePipe($pipe, $payload)
    {
        if ($pipe instanceof Closure) {
            // process pipe closure
            return call_user_func($pipe, $payload);
        } elseif ($pipe instanceof Pipeline) {
            // process another pipeline instance
            return $pipe->process($payload);
        } elseif (is_string($pipe) && class_exists($pipe)) {
            // process pipe class name
            return $this->processPipeClassName($pipe, $payload);
        } elseif (is_object($pipe)) {
            // process pipe object instance
            return $this->processPipeObject($pipe, $payload);
        } elseif (is_callable($pipe)) {
            // process callable pipe function
            return $pipe($payload);
        }

        // unknown pipe type
        throw new InvalidPipeException();
    }
protected function resolvePipe ( $ pipe , $ payload ) { if ( $ pipe instanceof Closure ) { // process pipe closure return call_user_func ( $ pipe , $ payload ) ; } elseif ( $ pipe instanceof Pipeline ) { // process another pipeline instance return $ pipe -> process ( $ payload ) ; } elseif ( is_string ( $ pipe ) && class_exists ( $ pipe ) ) { // process pipe class name return $ this -> processPipeClassName ( $ pipe , $ payload ) ; } elseif ( is_object ( $ pipe ) ) { // process pipe object instance return $ this -> processPipeObject ( $ pipe , $ payload ) ; } elseif ( is_callable ( $ pipe ) ) { // process callable pipe function return $ pipe ( $ payload ) ; } // unknown pipe type throw new InvalidPipeException ( ) ; }
Resolve a pipe execution

@param  mixed $pipe     Support closure, class instance, class string, pipeline instance and pipe function name
@param  mixed $payload  Payload pass to each pipe
@return mixed
@throws MissingPipeInterfaceException
@throws InvalidPipeException
Resolve a pipe execution