Skip to content

Commit 7057ad9

Browse files
committed
fix
1 parent 08705fa commit 7057ad9

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/Rules/PHPUnit/TestMethodsHelper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PHPStan\Type\FileTypeMapper;
1111
use PHPUnit\Framework\TestCase;
1212
use function array_key_exists;
13-
use function str_starts_with;
1413
use function strtolower;
1514

1615
final class TestMethodsHelper
@@ -62,7 +61,7 @@ public function getTestMethods(ClassReflection $classReflection, Scope $scope):
6261
continue;
6362
}
6463

65-
if (str_starts_with(strtolower($reflectionMethod->getName()), 'test')) {
64+
if (strpos(strtolower($reflectionMethod->getName()), 'test') === 0) {
6665
$testMethods[] = $reflectionMethod;
6766
continue;
6867
}

src/Type/PHPUnit/DynamicCallToAssertionIgnoreExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use PHPStan\Analyser\Scope;
99
use PHPUnit\Framework\TestCase;
1010
use function is_string;
11-
use function str_starts_with;
1211

1312
final class DynamicCallToAssertionIgnoreExtension implements IgnoreErrorExtension
1413
{
@@ -33,7 +32,7 @@ public function shouldIgnore(Error $error, Node $node, Scope $scope): bool
3332

3433
if (
3534
!$node->name instanceof Node\Identifier
36-
|| !str_starts_with($node->name->name, 'assert')
35+
|| strpos($node->name->name, 'assert') !== 0
3736
) {
3837
return false;
3938
}

0 commit comments

Comments
 (0)