src/mako/reactor/Dispatcher.php
protected function checkForInvalidArguments(CommandInterface $command, array $providedArguments, array $globalOptions): void
	{
		$commandArguments = array_keys($command->getCommandArguments() + $command->getCommandOptions());

		$defaultAndGlobalOptions = array_merge(['arg0', 'arg1'], $globalOptions);

		foreach(array_keys($providedArguments) as $name)
		{
			if(!in_array($name, $defaultAndGlobalOptions) && !in_array($name, $commandArguments))
			{
				if(strpos($name, 'arg') === 0)
				{
					throw new InvalidArgumentException(vsprintf('Invalid argument [ %s ].', [$name]), $name);
				}

				throw new InvalidOptionException(vsprintf('Invalid option [ %s ].', [$name]), $name, $this->suggest($name, $commandArguments));
			}
		}
	}
protected function checkForInvalidArguments(CommandInterface $command, array $providedArguments, array $globalOptions): void
	{
		$commandArguments = array_keys($command->getCommandArguments() + $command->getCommandOptions());

		$defaultAndGlobalOptions = array_merge(['arg0', 'arg1'], $globalOptions);

		foreach(array_keys($providedArguments) as $name)
		{
			if(!in_array($name, $defaultAndGlobalOptions) && !in_array($name, $commandArguments))
			{
				if(strpos($name, 'arg') === 0)
				{
					throw new InvalidArgumentException(vsprintf('Invalid argument [ %s ].', [$name]), $name);
				}

				throw new InvalidOptionException(vsprintf('Invalid option [ %s ].', [$name]), $name, $this->suggest($name, $commandArguments));
			}
		}
	}
protected function checkForInvalidArguments ( CommandInterface $ command , array $ providedArguments , array $ globalOptions ) : void { $ commandArguments = array_keys ( $ command -> getCommandArguments ( ) + $ command -> getCommandOptions ( ) ) ; $ defaultAndGlobalOptions = array_merge ( [ 'arg0' , 'arg1' ] , $ globalOptions ) ; foreach ( array_keys ( $ providedArguments ) as $ name ) { if ( ! in_array ( $ name , $ defaultAndGlobalOptions ) && ! in_array ( $ name , $ commandArguments ) ) { if ( strpos ( $ name , 'arg' ) === 0 ) { throw new InvalidArgumentException ( vsprintf ( 'Invalid argument [ %s ].' , [ $ name ] ) , $ name ) ; } throw new InvalidOptionException ( vsprintf ( 'Invalid option [ %s ].' , [ $ name ] ) , $ name , $ this -> suggest ( $ name , $ commandArguments ) ) ; } } }
Checks for invalid arguments or options.

@param  \mako\reactor\CommandInterface                    $command           Command arguments
@param  array                                             $providedArguments Provided arguments
@param  array                                             $globalOptions     Global options
@throws \mako\reactor\exceptions\InvalidArgumentException
@throws \mako\reactor\exceptions\InvalidOptionException
Checks for invalid arguments or options .