Layton/Console/Command.php
public function run($argv)
    {
        $args = $this->getArgs($argv);

        if (array_key_exists($args[1], $this->commands)) {
            $callback = $this->commands[$args[1]];
            $args = array_slice($args, 2);

            if (is_callable($callback)) {
                return $this->injectionClosure($callback, $args);
            }

            if (is_string($callback)) {
                if (strpos($callback, '>') !== false) {
                    list($controller, $method) = explode('>', $callback);
                    return $this->injectionClass($controller, $method, $args);
                }
                return $this->injectionClass($callback, '__invoke',  $args);
            }
        }
        throw new \Exception('command line callback not found.');
    }
public function run($argv)
    {
        $args = $this->getArgs($argv);

        if (array_key_exists($args[1], $this->commands)) {
            $callback = $this->commands[$args[1]];
            $args = array_slice($args, 2);

            if (is_callable($callback)) {
                return $this->injectionClosure($callback, $args);
            }

            if (is_string($callback)) {
                if (strpos($callback, '>') !== false) {
                    list($controller, $method) = explode('>', $callback);
                    return $this->injectionClass($controller, $method, $args);
                }
                return $this->injectionClass($callback, '__invoke',  $args);
            }
        }
        throw new \Exception('command line callback not found.');
    }
public function run ( $ argv ) { $ args = $ this -> getArgs ( $ argv ) ; if ( array_key_exists ( $ args [ 1 ] , $ this -> commands ) ) { $ callback = $ this -> commands [ $ args [ 1 ] ] ; $ args = array_slice ( $ args , 2 ) ; if ( is_callable ( $ callback ) ) { return $ this -> injectionClosure ( $ callback , $ args ) ; } if ( is_string ( $ callback ) ) { if ( strpos ( $ callback , '>' ) !== false ) { list ( $ controller , $ method ) = explode ( '>' , $ callback ) ; return $ this -> injectionClass ( $ controller , $ method , $ args ) ; } return $ this -> injectionClass ( $ callback , '__invoke' , $ args ) ; } } throw new \ Exception ( 'command line callback not found.' ) ; }
Match and run a command line.

@param array $argv The cli args
Match and run a command line .