Skip to content

Commit 1976edb

Browse files
Fix
1 parent 3889d28 commit 1976edb

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
@@ -72,7 +72,9 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
7272
$scope,
7373
NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope($scope, $node->var),
7474
sprintf('Access to property $%s on an unknown class %%s.', SprintfHelper::escapeFormatString($name)),
75-
static fn (Type $type): bool => $type->canAccessProperties()->yes() && $type->hasInstanceProperty($name)->yes(),
75+
static fn (Type $type): bool => $type->canAccessProperties()->yes() && (
76+
$type->hasInstanceProperty($name)->yes() || $type->hasStaticProperty($name)->yes()
77+
),
7678
);
7779
$type = $typeResult->getType();
7880
if ($type instanceof ErrorType) {

0 commit comments

Comments
 (0)