Skip to content

Commit 1202d8c

Browse files
Fix
1 parent ef2866b commit 1202d8c

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
@@ -101,7 +101,9 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
101101
$scope,
102102
NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope($scope, $node->var),
103103
sprintf('Access to property $%s on an unknown class %%s.', SprintfHelper::escapeFormatString($name)),
104-
static fn (Type $type): bool => $type->canAccessProperties()->yes() && $type->hasInstanceProperty($name)->yes(),
104+
static fn (Type $type): bool => $type->canAccessProperties()->yes() && (
105+
$type->hasInstanceProperty($name)->yes() || $type->hasStaticProperty($name)->yes()
106+
),
105107
);
106108
$type = $typeResult->getType();
107109
if ($type instanceof ErrorType) {

0 commit comments

Comments
 (0)