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

Function php_enclosing_call_name

codegraph-kernel/src/php.rs:1468–1481  ·  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

1466/// ≤4 parent hops to a function_call_expression; member/scoped calls abort
1467/// (method-call HOFs never qualify). (function-ref.ts:822)
1468fn php_enclosing_call_name(node: Node) -> Option<Node> {
1469 let mut cur = node.parent();
1470 for _ in 0..4 {
1471 let c = cur?;
1472 if c.kind() == "function_call_expression" {
1473 return c.child_by_field_name("function");
1474 }
1475 if matches!(c.kind(), "member_call_expression" | "scoped_call_expression") {
1476 return None;
1477 }
1478 cur = c.parent();
1479 }
1480 None
1481}
1482
1483fn find_anonymous_class_body(node: Node) -> Option<Node> {
1484 for i in 0..node.named_child_count() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected