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

Function phpEnclosingCallName

src/extraction/function-ref.ts:877–889  ·  view source on GitHub ↗

The function name of the PHP call whose arguments contain `node`, if any.

(node: SyntaxNode)

Source from the content-addressed store, hash-verified

875
876/** The function name of the PHP call whose arguments contain `node`, if any. */
877function phpEnclosingCallName(node: SyntaxNode): string | null {
878 let cur: SyntaxNode | null = node.parent;
879 for (let hops = 0; cur && hops < 4; hops++, cur = cur.parent) {
880 if (cur.type === 'function_call_expression') {
881 const fn = getChildByField(cur, 'function');
882 return fn ? fn.text : null;
883 }
884 if (cur.type === 'member_call_expression' || cur.type === 'scoped_call_expression') {
885 return null; // method calls aren't core HOFs
886 }
887 }
888 return null;
889}
890
891/** The Ruby `call` node whose argument_list (or keyword pair) contains `node`. */
892function rubyEnclosingCall(node: SyntaxNode): SyntaxNode | null {

Callers 1

normalizeSpecialFunction · 0.85

Calls 1

getChildByFieldFunction · 0.90

Tested by

no test coverage detected