Skip to content

Commit 55ac578

Browse files
committed
Cleaner attempt
1 parent 8b13441 commit 55ac578

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Type/ObjectType.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ public function getUnresolvedPropertyPrototype(string $propertyName, ClassMember
116116
$resolvedClassReflection = null;
117117
if ($ancestor !== null) {
118118
$resolvedClassReflection = $ancestor->getClassReflection();
119-
$nakedAncestorClassReflection = $ancestor->getNakedClassReflection();
120-
if ($nakedAncestorClassReflection !== null && $nakedAncestorClassReflection->hasProperty($propertyName)) {
121-
$property = $nakedAncestorClassReflection->getProperty($propertyName, $scope);
119+
if ($ancestor !== $this) {
120+
$property = $ancestor->getUnresolvedPropertyPrototype($propertyName, $scope)->getNakedProperty();
122121
}
123122
}
124123
if ($resolvedClassReflection === null) {
@@ -535,9 +534,8 @@ public function getUnresolvedMethodPrototype(string $methodName, ClassMemberAcce
535534
$resolvedClassReflection = null;
536535
if ($ancestor !== null) {
537536
$resolvedClassReflection = $ancestor->getClassReflection();
538-
$nakedAncestorClassReflection = $ancestor->getNakedClassReflection();
539-
if ($nakedAncestorClassReflection !== null && $nakedAncestorClassReflection->hasMethod($methodName)) {
540-
$method = $nakedAncestorClassReflection->getMethod($methodName, $scope);
537+
if ($ancestor !== $this) {
538+
$method = $ancestor->getUnresolvedMethodPrototype($methodName, $scope)->getNakedMethod();
541539
}
542540
}
543541
if ($resolvedClassReflection === null) {

0 commit comments

Comments
 (0)