Skip to content

Commit 2b6f352

Browse files
Fix issues reported by PHPStan
1 parent 3ffbee3 commit 2b6f352

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/Framework/RepeatTestSuite.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public function setDependencies(array $dependencies): void
103103
}
104104
}
105105

106+
/**
107+
* @return non-empty-string
108+
*/
106109
public function name(): string
107110
{
108111
return $this->tests[0]::class . '::' . $this->tests[0]->nameWithDataSet();

src/Framework/TestSuite.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ public function isForTestClass(): bool
538538
/**
539539
* @param ReflectionClass<TestCase> $class
540540
* @param list<non-empty-string> $groups
541+
* @param positive-int $numberOfRuns
541542
*
542543
* @throws Exception
543544
*/

src/Runner/Filter/NameFilterIterator.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,12 @@ public function accept(): bool
5757
return true;
5858
}
5959

60-
if (!$test instanceof TestCase) {
61-
return false;
62-
}
63-
6460
if ($test instanceof RepeatTestSuite) {
6561
$name = $test->name();
66-
} else {
62+
} elseif ($test instanceof TestCase) {
6763
$name = $test::class . '::' . $test->nameWithDataSet();
64+
} else {
65+
return false;
6866
}
6967

7068
$accepted = @preg_match($this->regularExpression, $name, $matches) === 1;

src/TextUI/Configuration/Cli/Configuration.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@
155155
private ?bool $noLogging;
156156
private ?bool $processIsolation;
157157
private ?int $randomOrderSeed;
158+
159+
/**
160+
* @var ?positive-int
161+
*/
158162
private ?int $repeat;
159163
private ?bool $reportUselessTests;
160164
private ?bool $resolveDependencies;
@@ -206,6 +210,7 @@
206210
* @param ?non-empty-list<non-empty-string> $testsUsing
207211
* @param ?non-empty-list<non-empty-string> $testsRequiringPhpExtension
208212
* @param ?non-empty-array<non-empty-string, non-empty-string> $iniSettings
213+
* @param ?positive-int $repeat
209214
* @param ?non-empty-list<non-empty-string> $testSuffixes
210215
* @param ?non-empty-list<non-empty-string> $coverageFilter
211216
* @param ?non-empty-list<non-empty-string> $extensions
@@ -2208,6 +2213,8 @@ public function hasRepeat(): bool
22082213

22092214
/**
22102215
* @throws Exception
2216+
*
2217+
* @return positive-int
22112218
*/
22122219
public function repeat(): int
22132220
{

0 commit comments

Comments
 (0)