Skip to content

Commit

Permalink
coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 1, 2021
1 parent 9875c73 commit bb3398c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/CommandLine/Parser.php
Expand Up @@ -117,7 +117,14 @@ public function parse(array $args = null): array
}
}

if (!empty($opt[self::ENUM]) && !in_array($arg, $opt[self::ENUM], true) && !($opt[self::OPTIONAL] && $arg === true)) {
if (
!empty($opt[self::ENUM])
&& !in_array($arg, $opt[self::ENUM], true)
&& !(
$opt[self::OPTIONAL]
&& $arg === true
)
) {
throw new \Exception("Value of option $name must be " . implode(', or ', $opt[self::ENUM]) . '.');
}
$this->checkArg($opt, $arg);
Expand Down

0 comments on commit bb3398c

Please sign in to comment.