Skip to content

Commit cf20b55

Browse files
Try
1 parent 2d034aa commit cf20b55

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

src/Type/ObjectShapeType.php

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,6 @@ public function getUnresolvedInstancePropertyPrototype(string $propertyName, Cla
137137
);
138138
}
139139

140-
public function hasStaticProperty(string $propertyName): TrinaryLogic
141-
{
142-
return TrinaryLogic::createNo();
143-
}
144-
145-
public function getStaticProperty(string $propertyName, ClassMemberAccessAnswerer $scope): ExtendedPropertyReflection
146-
{
147-
throw new ShouldNotHappenException();
148-
}
149-
150-
public function getUnresolvedStaticPropertyPrototype(string $propertyName, ClassMemberAccessAnswerer $scope): UnresolvedPropertyPrototypeReflection
151-
{
152-
throw new ShouldNotHappenException();
153-
}
154-
155140
public function accepts(Type $type, bool $strictTypes): AcceptsResult
156141
{
157142
if ($type instanceof CompoundType) {
@@ -189,8 +174,8 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
189174
if (in_array($propertyName, $this->optionalProperties, true)) {
190175
continue;
191176
}
192-
$result = $result->and($hasProperty);
193-
continue;
177+
178+
return $hasProperty;
194179
}
195180
if ($hasProperty->maybe()) {
196181
if (!in_array($propertyName, $this->optionalProperties, true)) {
@@ -301,7 +286,17 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
301286
}
302287

303288
$result = $result->and($hasProperty);
304-
$otherProperty = $type->getInstanceProperty($propertyName, $scope);
289+
<<<<<<< HEAD
290+
$otherProperty = $type->getProperty($propertyName, $scope);
291+
=======
292+
293+
try {
294+
$otherProperty = $type->getInstanceProperty($propertyName, $scope);
295+
} catch (MissingPropertyFromReflectionException) {
296+
return $result;
297+
}
298+
299+
>>>>>>> a507ab857 (Solve deprecations)
305300
if (!$otherProperty->isPublic()) {
306301
return IsSuperTypeOfResult::createNo();
307302
}

0 commit comments

Comments
 (0)