Skip to content

Commit 71ee779

Browse files
committed
Small code improvements
1 parent 6abc7ec commit 71ee779

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Rules/Keywords/RequireFileExistsRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function processNode(Node $node, Scope $scope): array
3030
$paths = $this->resolveFilePaths($node, $scope);
3131

3232
foreach ($paths as $path) {
33-
if (stream_resolve_include_path($path)) {
33+
if (stream_resolve_include_path($path) !== false) {
3434
continue;
3535
}
3636

tests/PHPStan/Rules/Keywords/RequireFileExistsRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
7+
use function get_include_path;
8+
use function implode;
9+
use function realpath;
10+
use function set_include_path;
11+
use const PATH_SEPARATOR;
712

813
/**
914
* @extends RuleTestCase<RequireFileExistsRule>

0 commit comments

Comments
 (0)