Skip to content

Commit 0abdb99

Browse files
Declare parameter types
1 parent 141f895 commit 0abdb99

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/Framework/Constraint/Operator/BinaryOperator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class BinaryOperator extends Operator
2525
protected function __construct(mixed ...$constraints)
2626
{
2727
$this->constraints = array_map(
28-
fn ($constraint): Constraint => $this->checkConstraint($constraint),
28+
fn (mixed $constraint): Constraint => $this->checkConstraint($constraint),
2929
$constraints,
3030
);
3131
}

src/Framework/ExecutionOrderDependency.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static function filterInvalid(array $dependencies): array
8585
public static function mergeUnique(array $existing, array $additional): array
8686
{
8787
$existingTargets = array_map(
88-
static fn ($dependency) => $dependency->getTarget(),
88+
static fn (ExecutionOrderDependency $dependency) => $dependency->getTarget(),
8989
$existing,
9090
);
9191

@@ -121,7 +121,7 @@ public static function diff(array $left, array $right): array
121121

122122
$diff = [];
123123
$rightTargets = array_map(
124-
static fn ($dependency) => $dependency->getTarget(),
124+
static fn (ExecutionOrderDependency $dependency) => $dependency->getTarget(),
125125
$right,
126126
);
127127

src/Logging/TestDox/NamePrettifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test,
274274

275275
if ($colorize) {
276276
$providedData = array_map(
277-
static fn ($value) => Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)),
277+
static fn (mixed $value) => Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)),
278278
$providedData,
279279
);
280280
}

src/Runner/TestSuiteSorter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private function sortDefectsFirst(array $tests): array
212212
{
213213
usort(
214214
$tests,
215-
fn ($left, $right) => $this->cmpDefectPriorityAndTime($left, $right),
215+
fn (Test $left, Test $right) => $this->cmpDefectPriorityAndTime($left, $right),
216216
);
217217

218218
return $tests;
@@ -227,7 +227,7 @@ private function sortByDuration(array $tests): array
227227
{
228228
usort(
229229
$tests,
230-
fn ($left, $right) => $this->cmpDuration($left, $right),
230+
fn (Test $left, Test $right) => $this->cmpDuration($left, $right),
231231
);
232232

233233
return $tests;
@@ -242,7 +242,7 @@ private function sortBySize(array $tests): array
242242
{
243243
usort(
244244
$tests,
245-
fn ($left, $right) => $this->cmpSize($left, $right),
245+
fn (Test $left, Test $right) => $this->cmpSize($left, $right),
246246
);
247247

248248
return $tests;

src/TextUI/Help.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function writeWithColor(): string
123123
$arg = Color::colorize('fg-green', str_pad($option['arg'], $this->lengthOfLongestOptionName));
124124
$arg = preg_replace_callback(
125125
'/(<[^>]+>)/',
126-
static fn ($matches) => Color::colorize('fg-cyan', $matches[0]),
126+
static fn (array $matches) => Color::colorize('fg-cyan', $matches[0]),
127127
$arg,
128128
);
129129

src/Util/Color.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static function colorizePath(string $path, ?string $previousPath = null,
138138
$last = count($path) - 1;
139139
$path[$last] = preg_replace_callback(
140140
'/([\-_.]+|phpt$)/',
141-
static fn ($matches) => self::dim($matches[0]),
141+
static fn (array $matches) => self::dim($matches[0]),
142142
$path[$last],
143143
);
144144
}
@@ -161,7 +161,7 @@ public static function visualizeWhitespace(string $buffer, bool $visualizeEOL =
161161

162162
return preg_replace_callback(
163163
'/\s+/',
164-
static fn ($matches) => self::dim(strtr($matches[0], $replaceMap)),
164+
static fn (array $matches) => self::dim(strtr($matches[0], $replaceMap)),
165165
$buffer,
166166
);
167167
}

0 commit comments

Comments
 (0)