public function testLenientArgsParsingDefaultsToApplicationValue() { $this->applicationConfig->enableLenientArgsParsing(); $this->assertTrue($this->config->isLenientArgsParsingEnabled()); $this->applicationConfig->disableLenientArgsParsing(); $this->assertFalse($this->config->isLenientArgsParsingEnabled()); }
/** * Parses the raw console arguments and returns the parsed arguments. * * @param RawArgs $args The raw console arguments. * @param bool $lenient Whether the parser should ignore parse errors. * If `true`, the parser will not throw any * exceptions when parse errors occur. * * @return Args The parsed console arguments. * * @throws CannotParseArgsException If the arguments cannot be parsed. */ public function parseArgs(RawArgs $args, $lenient = null) { if (null === $lenient) { $lenient = $this->config->isLenientArgsParsingEnabled(); } return $this->config->getArgsParser()->parseArgs($args, $this->argsFormat, $lenient); }