mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-13 15:40:05 +00:00
fix(php): prevent non-route closures from adopting parent route names
(cherry picked from commit 9d592e6996)
This commit is contained in:
1 parent
10f144de06
commit
904deaecab
1 file changed
+4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user