Skip to content

Commit 12e08c9

Browse files
committed
Fix
1 parent d0bf6b1 commit 12e08c9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Reflection/ClassReflection.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,7 @@ public function hasProperty(string $propertyName): bool
485485

486486
// For BC purpose
487487
if ($this->getPhpExtension()->hasProperty($this, $propertyName)) {
488-
$property = $this->getPhpExtension()->getProperty($this, $propertyName);
489-
if ($property->isStatic()) {
490-
return $this->hasPropertyCache[$propertyName] = true;
491-
}
488+
return $this->hasPropertyCache[$propertyName] = true;
492489
}
493490

494491
if ($this->requireExtendsPropertiesClassReflectionExtension->hasProperty($this, $propertyName)) {
@@ -513,6 +510,10 @@ public function hasInstanceProperty(string $propertyName): bool
513510
break;
514511
}
515512
if ($extension->hasProperty($this, $propertyName)) {
513+
$property = $extension->getProperty($this, $propertyName);
514+
if ($property->isStatic()) {
515+
continue;
516+
}
516517
return $this->hasInstancePropertyCache[$propertyName] = true;
517518
}
518519
}

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)