src/Cli.php
public function hasArgs($command = '') {
        $args = null;

        if ($command) {
            // Check to see if the specific command has args.
            $def = $this->getSchema($command);
            if (isset($def[Cli::META][Cli::ARGS])) {
                $args = $def[Cli::META][Cli::ARGS];
            }
        } else {
            foreach ($this->commandSchemas as $pattern => $def) {
                if (isset($def[Cli::META][Cli::ARGS])) {
                    $args = $def[Cli::META][Cli::ARGS];
                }
            }
            if (!empty($args)) {
                return 1;
            }
        }

        if (!$args || empty($args)) {
            return 0;
        }

        foreach ($args as $arg) {
            if (!Cli::val('required', $arg)) {
                return 1;
            }
        }
        return 2;
    }
public function hasArgs($command = '') {
        $args = null;

        if ($command) {
            // Check to see if the specific command has args.
            $def = $this->getSchema($command);
            if (isset($def[Cli::META][Cli::ARGS])) {
                $args = $def[Cli::META][Cli::ARGS];
            }
        } else {
            foreach ($this->commandSchemas as $pattern => $def) {
                if (isset($def[Cli::META][Cli::ARGS])) {
                    $args = $def[Cli::META][Cli::ARGS];
                }
            }
            if (!empty($args)) {
                return 1;
            }
        }

        if (!$args || empty($args)) {
            return 0;
        }

        foreach ($args as $arg) {
            if (!Cli::val('required', $arg)) {
                return 1;
            }
        }
        return 2;
    }
public function hasArgs ( $ command = '' ) { $ args = null ; if ( $ command ) { // Check to see if the specific command has args. $ def = $ this -> getSchema ( $ command ) ; if ( isset ( $ def [ Cli :: META ] [ Cli :: ARGS ] ) ) { $ args = $ def [ Cli :: META ] [ Cli :: ARGS ] ; } } else { foreach ( $ this -> commandSchemas as $ pattern => $ def ) { if ( isset ( $ def [ Cli :: META ] [ Cli :: ARGS ] ) ) { $ args = $ def [ Cli :: META ] [ Cli :: ARGS ] ; } } if ( ! empty ( $ args ) ) { return 1 ; } } if ( ! $ args || empty ( $ args ) ) { return 0 ; } foreach ( $ args as $ arg ) { if ( ! Cli :: val ( 'required' , $ arg ) ) { return 1 ; } } return 2 ; }
Determines whether or not a command has args.

@param string $command The command name to check.
@return int Returns one of the following.
- 0: The command has no args.
- 1: The command has optional args.
- 2: The command has required args.
Determines whether or not a command has args .