Skip to content

Commit cb0531b

Browse files
committed
Fix: Flip
1 parent 8a8c2bd commit cb0531b

File tree

2 files changed

+51
-53
lines changed

2 files changed

+51
-53
lines changed

psalm-baseline.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
<code>Extension</code>
99
</UnusedClass>
1010
<UnusedParam>
11-
<code>$configuration</code>
12-
<code>$facade</code>
13-
<code>$parameters</code>
11+
<code>$options</code>
1412
</UnusedParam>
1513
</file>
1614
<file src="src/Formatter/DefaultDurationFormatter.php">

src/Extension.php

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,7 @@
2626

2727
$major = (int) $matches['major'];
2828

29-
if (10 <= $major) {
30-
/**
31-
* @internal
32-
*/
33-
final class Extension implements Runner\Extension\Extension
34-
{
35-
public function bootstrap(
36-
TextUI\Configuration\Configuration $configuration,
37-
Runner\Extension\Facade $facade,
38-
Runner\Extension\ParameterCollection $parameters
39-
): void {
40-
if ($configuration->noOutput()) {
41-
return;
42-
}
43-
44-
$maximumCount = Count::fromInt(10);
45-
46-
if ($parameters->has('maximum-count')) {
47-
$maximumCount = Count::fromInt((int) $parameters->get('maximum-count'));
48-
}
49-
50-
$maximumDuration = Duration::fromMilliseconds(500);
51-
52-
if ($parameters->has('maximum-duration')) {
53-
$maximumDuration = Duration::fromMilliseconds((int) $parameters->get('maximum-duration'));
54-
}
55-
56-
$timeKeeper = new TimeKeeper();
57-
$collector = new Collector\DefaultCollector();
58-
$reporter = new Reporter\DefaultReporter(
59-
new Formatter\DefaultDurationFormatter(),
60-
$maximumDuration,
61-
$maximumCount,
62-
);
63-
64-
$facade->registerSubscribers(
65-
new Subscriber\TestPreparedSubscriber($timeKeeper),
66-
new Subscriber\TestPassedSubscriber(
67-
$maximumDuration,
68-
$timeKeeper,
69-
$collector,
70-
),
71-
new Subscriber\TestRunnerExecutionFinishedSubscriber(
72-
$collector,
73-
$reporter,
74-
),
75-
);
76-
}
77-
}
78-
} elseif (9 === $major) {
29+
if (9 === $major) {
7930
/**
8031
* @internal
8132
*/
@@ -215,6 +166,55 @@ private function resolveMaximumDuration(string $test): Duration
215166
return $this->maximumDuration;
216167
}
217168
}
169+
} elseif (10 <= $major) {
170+
/**
171+
* @internal
172+
*/
173+
final class Extension implements Runner\Extension\Extension
174+
{
175+
public function bootstrap(
176+
TextUI\Configuration\Configuration $configuration,
177+
Runner\Extension\Facade $facade,
178+
Runner\Extension\ParameterCollection $parameters
179+
): void {
180+
if ($configuration->noOutput()) {
181+
return;
182+
}
183+
184+
$maximumCount = Count::fromInt(10);
185+
186+
if ($parameters->has('maximum-count')) {
187+
$maximumCount = Count::fromInt((int) $parameters->get('maximum-count'));
188+
}
189+
190+
$maximumDuration = Duration::fromMilliseconds(500);
191+
192+
if ($parameters->has('maximum-duration')) {
193+
$maximumDuration = Duration::fromMilliseconds((int) $parameters->get('maximum-duration'));
194+
}
195+
196+
$timeKeeper = new TimeKeeper();
197+
$collector = new Collector\DefaultCollector();
198+
$reporter = new Reporter\DefaultReporter(
199+
new Formatter\DefaultDurationFormatter(),
200+
$maximumDuration,
201+
$maximumCount,
202+
);
203+
204+
$facade->registerSubscribers(
205+
new Subscriber\TestPreparedSubscriber($timeKeeper),
206+
new Subscriber\TestPassedSubscriber(
207+
$maximumDuration,
208+
$timeKeeper,
209+
$collector,
210+
),
211+
new Subscriber\TestRunnerExecutionFinishedSubscriber(
212+
$collector,
213+
$reporter,
214+
),
215+
);
216+
}
217+
}
218218
} else {
219219
throw new \RuntimeException(\sprintf(
220220
'Unable to select extension for PHPUnit version with version identifier "%s".',

0 commit comments

Comments
 (0)