Webmozart\Console\ConsoleApplication::getCommand PHP Method

getCommand() public method

public getCommand ( $name )
    public function getCommand($name)
    {
        return $this->commands->get($name);
    }

Usage Example

 public function testDoNotRethrowParseErrorIfLenient()
 {
     $config = ApplicationConfig::create()->beginCommand('package')->enableLenientArgsParsing()->end();
     $application = new ConsoleApplication($config);
     $command = $application->getCommand('package');
     $rawArgs = new StringArgs('package --foo');
     $resolvedCommand = $this->resolver->resolveCommand($rawArgs, $application, true);
     $args = new Args($command->getArgsFormat(), $rawArgs);
     $this->assertSame($command, $resolvedCommand->getCommand());
     $this->assertEquals($args, $resolvedCommand->getArgs());
 }
All Usage Examples Of Webmozart\Console\ConsoleApplication::getCommand