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

Method php_literal_text

codegraph-kernel/src/php.rs:1012–1027  ·  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

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

Callers 3

php_is_document_rootMethod · 0.80
php_appended_pathMethod · 0.80

Calls 2

mapMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected