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

Method php_static_include_path

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

phpStaticIncludePath (languages/php.ts): the path argument is namedChild(0), one `parenthesized_expression` unwrapped. A `binary_expression` reads as a path from the file's own directory or the web server's root (#3298), anything else as a pure string literal.

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

Source from the content-addressed store, hash-verified

983 /// `binary_expression` reads as a path from the file's own directory or
984 /// the web server's root (#3298), anything else as a pure string literal.
985 fn php_static_include_path(&mut self, node: Node<'t>) -> Option<String> {
986 let mut arg = node.named_child(0)?;
987 if arg.kind() == "parenthesized_expression" {
988 arg = arg.named_child(0)?;
989 }
990 if arg.kind() == "binary_expression" {
991 return self.php_directory_include_path(arg);
992 }
993 self.php_literal_text(arg).map(str::to_string)
994 }
995
996 /// phpLiteralText: a `string` / `encapsed_string` whose named children
997 /// are all `string_content` (any interpolation or escape → None); the

Callers 1

extract_importMethod · 0.80

Calls 3

mapMethod · 0.80
php_literal_textMethod · 0.80

Tested by

no test coverage detected