src/Chain.php
public function run()
    {
        if ($this->requires !== null && ! $this->instance instanceof $this->requires) {
            throw new WrongClassException(get_class($this->instance), $this->requires);
        }
        
        return array_reduce($this->methods, function ($results, $method) {
            if (! method_exists($this->instance, $method) && ! $this->forgiving) {
                throw new InvalidMethodException(get_class($this->instance), $method);
            }
            
            $results->addResult($method, call_user_func_array([$this->instance, $method], $this->parameters));
            
            return $results;
        }, new Results())->done();
    }
public function run()
    {
        if ($this->requires !== null && ! $this->instance instanceof $this->requires) {
            throw new WrongClassException(get_class($this->instance), $this->requires);
        }
        
        return array_reduce($this->methods, function ($results, $method) {
            if (! method_exists($this->instance, $method) && ! $this->forgiving) {
                throw new InvalidMethodException(get_class($this->instance), $method);
            }
            
            $results->addResult($method, call_user_func_array([$this->instance, $method], $this->parameters));
            
            return $results;
        }, new Results())->done();
    }
public function run ( ) { if ( $ this -> requires !== null && ! $ this -> instance instanceof $ this -> requires ) { throw new WrongClassException ( get_class ( $ this -> instance ) , $ this -> requires ) ; } return array_reduce ( $ this -> methods , function ( $ results , $ method ) { if ( ! method_exists ( $ this -> instance , $ method ) && ! $ this -> forgiving ) { throw new InvalidMethodException ( get_class ( $ this -> instance ) , $ method ) ; } $ results -> addResult ( $ method , call_user_func_array ( [ $ this -> instance , $ method ] , $ this -> parameters ) ) ; return $ results ; } , new Results ( ) ) -> done ( ) ; }
Run the Chain of methods on the Class.

@return CupOfTea\Chain\Results Object containing the results from each method.
Run the Chain of methods on the Class .