Skip to content

Commit 913e05b

Browse files
committed
Fix
1 parent d0bf6b1 commit 913e05b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Reflection/ClassReflection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ public function hasInstanceProperty(string $propertyName): bool
513513
break;
514514
}
515515
if ($extension->hasProperty($this, $propertyName)) {
516+
$property = $extension->getProperty($this, $propertyName);
517+
if ($property->isStatic()) {
518+
continue;
519+
}
516520
return $this->hasInstancePropertyCache[$propertyName] = true;
517521
}
518522
}

src/Type/ObjectShapeType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
185185
),
186186
],
187187
);
188-
if (!$hasProperty->yes() && $type->hasStaticProperty($propertyName)->yes()) {
188+
if (!$hasProperty->yes() && $type->hasStaticProperty((string) $propertyName)->yes()) {
189189
$result = $result->and(new AcceptsResult(TrinaryLogic::createNo(), [
190-
sprintf('Property %s::$%s is static.', $type->getStaticProperty($propertyName, $scope)->getDeclaringClass()->getDisplayName(), $propertyName),
190+
sprintf('Property %s::$%s is static.', $type->getStaticProperty((string) $propertyName, $scope)->getDeclaringClass()->getDisplayName(), $propertyName),
191191
]));
192192
continue;
193193
}

0 commit comments

Comments
 (0)