Skip to content

Commit a03cf97

Browse files
Closes #5746
1 parent d138c06 commit a03cf97

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ChangeLog-10.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
1717
### Fixed
1818

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

2122
## [10.5.12] - 2024-03-09
2223

src/TextUI/Configuration/Cli/Builder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ public function fromParameters(array $parameters): Configuration
251251
$debug = false;
252252

253253
foreach ($options[0] as $option) {
254+
$optionAllowedMultipleTimes = false;
255+
254256
switch ($option[0]) {
255257
case '--colors':
256258
$colors = $option[1] ?: \PHPUnit\TextUI\Configuration\Configuration::COLOR_AUTO;
@@ -364,6 +366,8 @@ public function fromParameters(array $parameters): Configuration
364366
}
365367
}
366368

369+
$optionAllowedMultipleTimes = true;
370+
367371
break;
368372

369373
case 'h':
@@ -845,7 +849,9 @@ public function fromParameters(array $parameters): Configuration
845849
break;
846850
}
847851

848-
$this->markProcessed($option[0]);
852+
if (!$optionAllowedMultipleTimes) {
853+
$this->markProcessed($option[0]);
854+
}
849855
}
850856

851857
if (empty($iniSettings)) {

0 commit comments

Comments
 (0)