Skip to content

Commit 1eeccd2

Browse files
Fix
1 parent 2d034aa commit 1eeccd2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Type/ObjectShapeType.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
185185
),
186186
],
187187
);
188+
if (!$hasProperty->yes() && $type->hasStaticProperty($propertyName)->yes()) {
189+
$result = $result->and(new AcceptsResult(TrinaryLogic::createNo(), [
190+
sprintf('Property %s::$%s is static.', $type->getStaticProperty($propertyName, $scope)->getDeclaringClass()->getDisplayName(), $propertyName),
191+
]));
192+
continue;
193+
}
188194
if ($hasProperty->no()) {
189195
if (in_array($propertyName, $this->optionalProperties, true)) {
190196
continue;
@@ -202,12 +208,6 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
202208
$hasProperty = AcceptsResult::createYes();
203209
}
204210

205-
if (!$hasProperty->yes() && $type->hasStaticProperty($propertyName)->yes()) {
206-
return new AcceptsResult(TrinaryLogic::createNo(), [
207-
sprintf('Property %s::$%s is static.', $type->getStaticProperty($propertyName, $scope)->getDeclaringClass()->getDisplayName(), $propertyName),
208-
]);
209-
}
210-
211211
$result = $result->and($hasProperty);
212212
$otherProperty = $type->getInstanceProperty($propertyName, $scope);
213213
if (!$otherProperty->isPublic()) {

0 commit comments

Comments
 (0)