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

Method php_is_document_root

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

phpIsDocumentRoot (#3298): `$_SERVER['DOCUMENT_ROOT']`, in either quote and with any spacing inside the brackets — a `subscript_expression` of exactly the `variable_name` `$_SERVER` and a pure string literal `DOCUMENT_ROOT`.

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1031 /// `subscript_expression` of exactly the `variable_name` `$_SERVER` and
1032 /// a pure string literal `DOCUMENT_ROOT`.
1033 fn php_is_document_root(&self, node: Node<'t>) -> bool {
1034 node.kind() == "subscript_expression"
1035 && node.named_child_count() == 2
1036 && node
1037 .named_child(0)
1038 .is_some_and(|v| v.kind() == "variable_name" && self.text(v) == "$_SERVER")
1039 && node.named_child(1).and_then(|key| self.php_literal_text(key)) == Some("DOCUMENT_ROOT")
1040 }
1041
1042 /// phpAppendedPath (#3298): the path string literals (and
1043 /// `DIRECTORY_SEPARATOR`, read as `/`) append to a directory. It starts

Callers 1

Calls 2

php_literal_textMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected