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

Function php_enclosing_call_name

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

1606/// ≤4 parent hops to a function_call_expression; member/scoped calls abort
1607/// (method-call HOFs never qualify). (function-ref.ts:822)
1608fn php_enclosing_call_name(node: Node) -> Option<Node> {
1609 let mut cur = node.parent();
1610 for _ in 0..4 {
1611 let c = cur?;
1612 if c.kind() == "function_call_expression" {
1613 return c.child_by_field_name("function");
1614 }
1615 if matches!(c.kind(), "member_call_expression" | "scoped_call_expression") {
1616 return None;
1617 }
1618 cur = c.parent();
1619 }
1620 None
1621}
1622
1623/// PHP_DOCUMENT_ROOT (languages/php.ts, #3298): how an include built from
1624/// `$_SERVER['DOCUMENT_ROOT']` is written, followed by the appended path. The

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected