Skip to content

Commit f48c3c3

Browse files
committed
fix
1 parent 84a67bb commit f48c3c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rules/Symfony73/GetMethodToAsTwigAttributeTransformer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public function transformClassGetMethodToAttributeMarker(
5858
return false;
5959
}
6060

61+
$originalMethod = clone $getMethod;
62+
6163
$hasChanged = false;
6264
foreach ((array) $getMethod->stmts as $stmt) {
6365
// handle return array simple case
@@ -94,7 +96,8 @@ public function transformClassGetMethodToAttributeMarker(
9496
if ($this->isLocalCallable($secondArg->value)) {
9597
$localMethodName = $this->localArrayMethodCallableMatcher->match($secondArg->value, $objectType);
9698
if (! is_string($localMethodName)) {
97-
continue;
99+
$getMethod = $originalMethod;
100+
return false;
98101
}
99102

100103
$localMethod = $class->getMethod($localMethodName);

0 commit comments

Comments
 (0)