phpLiteralText: a `string` / `encapsed_string` whose named children are all `string_content` (any interpolation or escape → None); the first one's text.
(&self, arg: Node)
| 1010 | /// are all `string_content` (any interpolation or escape → None); the |
| 1011 | /// first one's text. |
| 1012 | fn php_literal_text(&self, arg: Node) -> Option<&'t str> { |
| 1013 | if !matches!(arg.kind(), "string" | "encapsed_string") { |
| 1014 | return None; |
| 1015 | } |
| 1016 | let mut content: Option<Node> = None; |
| 1017 | for i in 0..arg.named_child_count() { |
| 1018 | let Some(c) = arg.named_child(i) else { continue }; |
| 1019 | if c.kind() != "string_content" { |
| 1020 | return None; |
| 1021 | } |
| 1022 | if content.is_none() { |
| 1023 | content = Some(c); |
| 1024 | } |
| 1025 | } |
| 1026 | content.map(|c| self.text(c)) |
| 1027 | } |
| 1028 | |
| 1029 | /// phpIsDocumentRoot (#3298): `$_SERVER['DOCUMENT_ROOT']`, in either |
| 1030 | /// quote and with any spacing inside the brackets — a |
no test coverage detected