Content of a PHP string literal node (single- or double-quoted).
(node: SyntaxNode, source: string)
| 811 | |
| 812 | /** Content of a PHP string literal node (single- or double-quoted). */ |
| 813 | function phpStringContent(node: SyntaxNode, source: string): string | null { |
| 814 | for (let i = 0; i < node.namedChildCount; i++) { |
| 815 | const child = node.namedChild(i); |
| 816 | if (child?.type === 'string_content') return getNodeText(child, source).trim(); |
| 817 | } |
| 818 | return null; |
| 819 | } |
| 820 | |
| 821 | /** The function name of the PHP call whose arguments contain `node`, if any. */ |
| 822 | function phpEnclosingCallName(node: SyntaxNode): string | null { |
no test coverage detected