Skip to content

Commit a848d4a

Browse files
Fix
1 parent bfd6fe5 commit a848d4a

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
@@ -67,7 +67,9 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
6767
$scope,
6868
NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope($scope, $node->var),
6969
sprintf('Access to property $%s on an unknown class %%s.', SprintfHelper::escapeFormatString($name)),
70-
static fn (Type $type): bool => $type->canAccessProperties()->yes() && $type->hasInstanceProperty($name)->yes(),
70+
static fn (Type $type): bool => $type->canAccessProperties()->yes() && (
71+
$type->hasInstanceProperty($name)->yes() || $type->hasStaticProperty($name)->yes()
72+
),
7173
);
7274
$type = $typeResult->getType();
7375
if ($type instanceof ErrorType) {

0 commit comments

Comments
 (0)