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)
| 997 | /// are all `string_content` (any interpolation or escape → None); the |
| 998 | /// first one's text. |
| 999 | fn php_literal_text(&self, arg: Node) -> Option<&'t str> { |
| 1000 | if !matches!(arg.kind(), "string" | "encapsed_string") { |
| 1001 | return None; |
| 1002 | } |
| 1003 | let mut content: Option<Node> = None; |
| 1004 | for c in arg.named_children(&mut arg.walk()) { |
| 1005 | if c.kind() != "string_content" { |
| 1006 | return None; |
| 1007 | } |
| 1008 | if content.is_none() { |
| 1009 | content = Some(c); |
| 1010 | } |
| 1011 | } |
| 1012 | content.map(|c| self.text(c)) |
| 1013 | } |
| 1014 | |
| 1015 | /// phpIsDocumentRoot (#3298): `$_SERVER['DOCUMENT_ROOT']`, in either |
| 1016 | /// quote and with any spacing inside the brackets — a |
no test coverage detected