Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 4, 2021
1 parent d1bb620 commit f03dd17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Parser.php
Expand Up @@ -38,8 +38,8 @@ final class Parser
* @psalm-return array{0: array, 1: array}
*
* @throws AmbiguousOptionException
* @throws RequiredOptionArgumentMissingException
* @throws OptionDoesNotAllowArgumentException
* @throws RequiredOptionArgumentMissingException
* @throws UnknownOptionException
*/
public function parse(array $argv, string $shortOptions, array $longOptions = null): array
Expand All @@ -48,8 +48,8 @@ public function parse(array $argv, string $shortOptions, array $longOptions = nu
return [[], []];
}

$options = [];
$nonOptions = [];
$options = [];
$nonOptions = [];

if ($longOptions) {
sort($longOptions);
Expand Down Expand Up @@ -149,8 +149,8 @@ private function parseShortOption(string $argument, string $shortOptions, array
* @psalm-param list<string> $longOptions
*
* @throws AmbiguousOptionException
* @throws RequiredOptionArgumentMissingException
* @throws OptionDoesNotAllowArgumentException
* @throws RequiredOptionArgumentMissingException
* @throws UnknownOptionException
*/
private function parseLongOption(string $argument, array $longOptions, array &$options, array &$argv): void
Expand Down Expand Up @@ -192,8 +192,8 @@ private function parseLongOption(string $argument, array $longOptions, array &$o
throw new OptionDoesNotAllowArgumentException('--' . $option);
}

$fullOption = '--' . preg_replace('/={1,2}$/', '', $longOption);
$options[] = [$fullOption, $optionArgument];
$fullOption = '--' . preg_replace('/={1,2}$/', '', $longOption);
$options[] = [$fullOption, $optionArgument];

return;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ParserTest.php
Expand Up @@ -12,9 +12,9 @@
use PHPUnit\Framework\TestCase;

/**
* @covers \SebastianBergmann\CliParser\Parser
* @covers \SebastianBergmann\CliParser\AmbiguousOptionException
* @covers \SebastianBergmann\CliParser\OptionDoesNotAllowArgumentException
* @covers \SebastianBergmann\CliParser\Parser
* @covers \SebastianBergmann\CliParser\RequiredOptionArgumentMissingException
* @covers \SebastianBergmann\CliParser\UnknownOptionException
*/
Expand Down

0 comments on commit f03dd17

Please sign in to comment.