Content of a PHP string literal node (single- or double-quoted).
(node: SyntaxNode, source: string)
| 843 | |
| 844 | /** Content of a PHP string literal node (single- or double-quoted). */ |
| 845 | function phpStringContent(node: SyntaxNode, source: string): string | null { |
| 846 | for (let i = 0; i < node.namedChildCount; i++) { |
| 847 | const child = node.namedChild(i); |
| 848 | if (child?.type === 'string_content') return getNodeText(child, source).trim(); |
| 849 | } |
| 850 | return null; |
| 851 | } |
| 852 | |
| 853 | /** The function name of the PHP call whose arguments contain `node`, if any. */ |
| 854 | function phpEnclosingCallName(node: SyntaxNode): string | null { |
no test coverage detected