Skip to content

Commit

Permalink
don't overwrite previous extension results
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jan 6, 2024
1 parent 1e8ea57 commit b69346e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope):
}
$this->methods[$key] = $method;
}
}

if (!isset($this->methods[$key])) {
if ($this->requireExtendsMethodsClassReflectionExtension->hasMethod($this, $methodName)) {
$method = $this->requireExtendsMethodsClassReflectionExtension->getMethod($this, $methodName);
$this->methods[$key] = $method;
Expand Down Expand Up @@ -595,6 +597,7 @@ public function getProperty(string $propertyName, ClassMemberAccessAnswerer $sco
if ($scope->isInClass()) {
$key = sprintf('%s-%s', $key, $scope->getClassReflection()->getCacheKey());
}

if (!isset($this->properties[$key])) {
foreach ($this->propertiesClassReflectionExtensions as $i => $extension) {
if ($i > 0 && !$this->allowsDynamicPropertiesExtensions()) {
Expand All @@ -611,7 +614,9 @@ public function getProperty(string $propertyName, ClassMemberAccessAnswerer $sco
}
$this->properties[$key] = $property;
}
}

if (!isset($this->properties[$key])) {
if ($this->requireExtendsPropertiesClassReflectionExtension->hasProperty($this, $propertyName)) {
$property = $this->requireExtendsPropertiesClassReflectionExtension->getProperty($this, $propertyName);
$this->properties[$key] = $property;
Expand Down

0 comments on commit b69346e

Please sign in to comment.