The function name of the PHP call whose arguments contain `node`, if any.
(node: SyntaxNode)
| 820 | |
| 821 | /** The function name of the PHP call whose arguments contain `node`, if any. */ |
| 822 | function phpEnclosingCallName(node: SyntaxNode): string | null { |
| 823 | let cur: SyntaxNode | null = node.parent; |
| 824 | for (let hops = 0; cur && hops < 4; hops++, cur = cur.parent) { |
| 825 | if (cur.type === 'function_call_expression') { |
| 826 | const fn = getChildByField(cur, 'function'); |
| 827 | return fn ? fn.text : null; |
| 828 | } |
| 829 | if (cur.type === 'member_call_expression' || cur.type === 'scoped_call_expression') { |
| 830 | return null; // method calls aren't core HOFs |
| 831 | } |
| 832 | } |
| 833 | return null; |
| 834 | } |
| 835 | |
| 836 | /** The Ruby `call` node whose argument_list (or keyword pair) contains `node`. */ |
| 837 | function rubyEnclosingCall(node: SyntaxNode): SyntaxNode | null { |
no test coverage detected