Skip to content

Commit 04989d6

Browse files
Fix
1 parent 872fb34 commit 04989d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Rules/Properties/AccessPropertiesCheck.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
9191
$scope,
9292
NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope($scope, $node->var),
9393
sprintf('Access to property $%s on an unknown class %%s.', SprintfHelper::escapeFormatString($name)),
94-
static fn (Type $type): bool => $type->canAccessProperties()->yes() && $type->hasInstanceProperty($name)->yes(),
94+
static fn (Type $type): bool => $type->canAccessProperties()->yes() && (
95+
$type->hasInstanceProperty($name)->yes() || $type->hasStaticProperty($name)->yes()
96+
),
9597
);
9698
$type = $typeResult->getType();
9799
if ($type instanceof ErrorType) {

0 commit comments

Comments
 (0)