fix(php): prevent non-route closures from adopting parent route names

(cherry picked from commit 9d592e6996)
This commit is contained in:
nikhil2004 authored and safishamsi committed 2026-09-23 19:42:04 +01:00
1 parent 10f144de06
commit 904deaecab
1 file changed
+4
+4
View File
@@ -3512,6 +3512,10 @@ def _php_get_route_name(closure_node, src: bytes) -> str | None:
continue
elif curr.type in ("anonymous_function", "arrow_function"):
if verb is None:
# We are a non-route closure nested inside another closure.
# Don't adopt the outer closure's route.
return None
# Jump across the closure boundary to its containing argument
curr = curr.parent
continue