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