public function run($name, array $arguments = [])
    {
        foreach ($this->getModules() as $module)
        {
            $instance = $this->getInstance($module);

            if ($this->hasMethod($instance, $name))
            {
                return call_user_func_array([$instance, $name], $arguments);
            }
        }

        throw new BadMethodCallException("Method {$name} does not exist");
    }
public function run($name, array $arguments = [])
    {
        foreach ($this->getModules() as $module)
        {
            $instance = $this->getInstance($module);

            if ($this->hasMethod($instance, $name))
            {
                return call_user_func_array([$instance, $name], $arguments);
            }
        }

        throw new BadMethodCallException("Method {$name} does not exist");
    }
public function run ( $ name , array $ arguments = [ ] ) { foreach ( $ this -> getModules ( ) as $ module ) { $ instance = $ this -> getInstance ( $ module ) ; if ( $ this -> hasMethod ( $ instance , $ name ) ) { return call_user_func_array ( [ $ instance , $ name ] , $ arguments ) ; } } throw new BadMethodCallException ( "Method {$name} does not exist" ) ; }
Run a method and return its output.

@throws BadMethodCallException
@param string $name
@param array $arguments
@return mixed
Run a method and return its output .