Webmozart\Console\Api\Args\Args::isArgumentSet PHP Méthode

isArgumentSet() public méthode

Returns whether an argument is set.
public isArgumentSet ( string | integer $name ) : boolean
$name string | integer The argument name or its 0-based position in the argument list.
Résultat boolean Returns `true` if the argument is set and `false` otherwise.
    public function isArgumentSet($name)
    {
        return array_key_exists($name, $this->arguments);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function handle(Args $args, IO $io, Command $command)
 {
     $application = $command->getApplication();
     if ($args->isArgumentSet('command')) {
         $theCommand = $application->getCommand($args->getArgument('command'));
         $usage = new CommandHelp($theCommand);
     } else {
         $usage = new ApplicationHelp($application);
     }
     $usage->render($io);
     return 0;
 }
All Usage Examples Of Webmozart\Console\Api\Args\Args::isArgumentSet