Skip to content

Commit 8282cc8

Browse files
authored
CI: Fix PHP7.4 build (#327)
1 parent 203970d commit 8282cc8

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Rules/PHPUnit/TestMethodsHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use PHPStan\Type\FileTypeMapper;
1111
use PHPUnit\Framework\TestCase;
1212
use function array_key_exists;
13-
use function str_starts_with;
13+
use function strpos;
1414
use function strtolower;
1515

1616
final class TestMethodsHelper
@@ -62,7 +62,7 @@ public function getTestMethods(ClassReflection $classReflection, Scope $scope):
6262
continue;
6363
}
6464

65-
if (str_starts_with(strtolower($reflectionMethod->getName()), 'test')) {
65+
if (strpos(strtolower($reflectionMethod->getName()), 'test') === 0) {
6666
$testMethods[] = $reflectionMethod;
6767
continue;
6868
}

src/Type/PHPUnit/DynamicCallToAssertionIgnoreExtension.php

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

1313
final class DynamicCallToAssertionIgnoreExtension implements IgnoreErrorExtension
1414
{
@@ -33,7 +33,7 @@ public function shouldIgnore(Error $error, Node $node, Scope $scope): bool
3333

3434
if (
3535
!$node->name instanceof Node\Identifier
36-
|| !str_starts_with($node->name->name, 'assert')
36+
|| strpos($node->name->name, 'assert') !== 0
3737
) {
3838
return false;
3939
}

0 commit comments

Comments
 (0)