MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / php_enclosing_call_name

Function php_enclosing_call_name

codegraph-kernel/src/php.rs:1483–1496  ·  view source on GitHub ↗

The function name node of the php call whose arguments contain `node` — ≤4 parent hops to a function_call_expression; member/scoped calls abort (method-call HOFs never qualify). (function-ref.ts:822)

(node: Node)

Source from the content-addressed store, hash-verified

1481/// ≤4 parent hops to a function_call_expression; member/scoped calls abort
1482/// (method-call HOFs never qualify). (function-ref.ts:822)
1483fn php_enclosing_call_name(node: Node) -> Option<Node> {
1484 let mut cur = node.parent();
1485 for _ in 0..4 {
1486 let c = cur?;
1487 if c.kind() == "function_call_expression" {
1488 return c.child_by_field_name("function");
1489 }
1490 if matches!(c.kind(), "member_call_expression" | "scoped_call_expression") {
1491 return None;
1492 }
1493 cur = c.parent();
1494 }
1495 None
1496}
1497
1498fn find_anonymous_class_body(node: Node) -> Option<Node> {
1499 for i in 0..node.named_child_count() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected