Webmozart\Console\Api\Command\Command::parseArgs PHP Method

parseArgs() public method

Parses the raw console arguments and returns the parsed arguments.
public parseArgs ( Webmozart\Console\Api\Args\RawArgs $args, boolean $lenient = null ) : Args
$args Webmozart\Console\Api\Args\RawArgs The raw console arguments.
$lenient boolean Whether the parser should ignore parse errors. If `true`, the parser will not throw any exceptions when parse errors occur.
return Webmozart\Console\Api\Args\Args The parsed console arguments.
    public function parseArgs(RawArgs $args, $lenient = null)
    {
        if (null === $lenient) {
            $lenient = $this->config->isLenientArgsParsingEnabled();
        }
        return $this->config->getArgsParser()->parseArgs($args, $this->argsFormat, $lenient);
    }

Usage Example

コード例 #1
0
 /**
  * @expectedException \Puli\Manager\Api\Server\NoSuchServerException
  */
 public function testDeleteServerFailsIfNotFound()
 {
     $this->serverManager->expects($this->once())->method('hasServer')->with('localhost')->willReturn(false);
     $this->serverManager->expects($this->never())->method('removeServer');
     $args = self::$deleteCommand->parseArgs(new StringArgs('localhost'));
     $this->handler->handleDelete($args);
 }
All Usage Examples Of Webmozart\Console\Api\Command\Command::parseArgs