Skip to content

Commit 7589f95

Browse files
Fix
1 parent 6f5973b commit 7589f95

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
@@ -97,7 +97,9 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
9797
$scope,
9898
NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope($scope, $node->var),
9999
sprintf('Access to property $%s on an unknown class %%s.', SprintfHelper::escapeFormatString($name)),
100-
static fn (Type $type): bool => $type->canAccessProperties()->yes() && $type->hasInstanceProperty($name)->yes(),
100+
static fn (Type $type): bool => $type->canAccessProperties()->yes() && (
101+
$type->hasInstanceProperty($name)->yes() || $type->hasStaticProperty($name)->yes()
102+
),
101103
);
102104
$type = $typeResult->getType();
103105
if ($type instanceof ErrorType) {

0 commit comments

Comments
 (0)