MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / php_literal_text

Method php_literal_text

codegraph-kernel/src/php.rs:999–1013  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

php_is_document_rootMethod · 0.80
php_appended_pathMethod · 0.80

Calls 3

mapMethod · 0.80
textMethod · 0.65
walkMethod · 0.45

Tested by

no test coverage detected