src/Phapi/Di/Validator/Contract.php
public function validate($value)
    {
        $original = $value;

        // Check if we are using a callable to get the pipeline
        if (is_callable($value) && $value instanceof \Closure) {
            $value = $value($this->container);
        }

        // Check if we have a valid pipeline instance
        if (!$value instanceof $this->contract) {
            throw new \RuntimeException('The configured value does not implement '. $this->contract);
        }

        // All good return original
        return $original;
    }
public function validate($value)
    {
        $original = $value;

        // Check if we are using a callable to get the pipeline
        if (is_callable($value) && $value instanceof \Closure) {
            $value = $value($this->container);
        }

        // Check if we have a valid pipeline instance
        if (!$value instanceof $this->contract) {
            throw new \RuntimeException('The configured value does not implement '. $this->contract);
        }

        // All good return original
        return $original;
    }
public function validate ( $ value ) { $ original = $ value ; // Check if we are using a callable to get the pipeline if ( is_callable ( $ value ) && $ value instanceof \ Closure ) { $ value = $ value ( $ this -> container ) ; } // Check if we have a valid pipeline instance if ( ! $ value instanceof $ this -> contract ) { throw new \ RuntimeException ( 'The configured value does not implement ' . $ this -> contract ) ; } // All good return original return $ original ; }
Validate middleware pipeline

@trows \RuntimeException when the configured pipeline does not implement the Pipeline Contract
@param $value
@return mixed
Validate middleware pipeline