Skip to content

Commit 79dfb6a

Browse files
committed
Iterate over methods from other extension even when native PHP method exists (but cannot be called from the current scope)
1 parent 398622a commit 79dfb6a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/Reflection/ClassReflection.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -589,18 +589,16 @@ public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope):
589589
$this->methods[$key] = $method;
590590
}
591591

592-
if (!isset($this->methods[$key])) {
593-
foreach ($this->methodsClassReflectionExtensions as $extension) {
594-
if (!$extension->hasMethod($this, $methodName)) {
595-
continue;
596-
}
592+
foreach ($this->methodsClassReflectionExtensions as $extension) {
593+
if (!$extension->hasMethod($this, $methodName)) {
594+
continue;
595+
}
597596

598-
$method = $this->wrapExtendedMethod($extension->getMethod($this, $methodName));
599-
if ($scope->canCallMethod($method)) {
600-
return $this->methods[$key] = $method;
601-
}
602-
$this->methods[$key] = $method;
597+
$method = $this->wrapExtendedMethod($extension->getMethod($this, $methodName));
598+
if ($scope->canCallMethod($method)) {
599+
return $this->methods[$key] = $method;
603600
}
601+
$this->methods[$key] = $method;
604602
}
605603

606604
if (!isset($this->methods[$key])) {

0 commit comments

Comments
 (0)