Skip to content

Commit

Permalink
Closes #5746
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 12, 2024
1 parent d138c06 commit a03cf97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog-10.5.md
Expand Up @@ -17,6 +17,7 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
### Fixed

* [#5351](https://github.com/sebastianbergmann/phpunit/issues/5351): Incorrect code coverage metadata does not prevent code coverage data from being collected
* [#5746](https://github.com/sebastianbergmann/phpunit/issues/5746): Using `-d` CLI option multiple times triggers warning

## [10.5.12] - 2024-03-09

Expand Down
8 changes: 7 additions & 1 deletion src/TextUI/Configuration/Cli/Builder.php
Expand Up @@ -251,6 +251,8 @@ public function fromParameters(array $parameters): Configuration
$debug = false;

foreach ($options[0] as $option) {
$optionAllowedMultipleTimes = false;

switch ($option[0]) {
case '--colors':
$colors = $option[1] ?: \PHPUnit\TextUI\Configuration\Configuration::COLOR_AUTO;
Expand Down Expand Up @@ -364,6 +366,8 @@ public function fromParameters(array $parameters): Configuration
}
}

$optionAllowedMultipleTimes = true;

break;

case 'h':
Expand Down Expand Up @@ -845,7 +849,9 @@ public function fromParameters(array $parameters): Configuration
break;
}

$this->markProcessed($option[0]);
if (!$optionAllowedMultipleTimes) {
$this->markProcessed($option[0]);
}
}

if (empty($iniSettings)) {
Expand Down

0 comments on commit a03cf97

Please sign in to comment.