Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 1e6d7c3

Browse files
committed
Leave more complex cases for the end
1 parent fe8e73f commit 1e6d7c3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/RequireFileExistsRule.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ private function resolveFilePath(Node $node, Scope $scope): ?string
5757
return $node->value;
5858
}
5959

60-
if ($node instanceof Concat) {
61-
$left = $this->resolveFilePath($node->left, $scope);
62-
$right = $this->resolveFilePath($node->right, $scope);
63-
if ($left !== null && $right !== null) {
64-
return $left . $right;
65-
}
66-
}
67-
6860
if ($node instanceof Dir) {
6961
return dirname($scope->getFile());
7062
}
@@ -73,6 +65,14 @@ private function resolveFilePath(Node $node, Scope $scope): ?string
7365
return $this->resolveClassConstant($node);
7466
}
7567

68+
if ($node instanceof Concat) {
69+
$left = $this->resolveFilePath($node->left, $scope);
70+
$right = $this->resolveFilePath($node->right, $scope);
71+
if ($left !== null && $right !== null) {
72+
return $left . $right;
73+
}
74+
}
75+
7676
return null;
7777
}
7878

0 commit comments

Comments
 (0)