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

Method php_static_include_path

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

996 /// `binary_expression` reads as a path from the file's own directory or
997 /// the web server's root (#3298), anything else as a pure string literal.
998 fn php_static_include_path(&mut self, node: Node<'t>) -> Option<String> {
999 let mut arg = node.named_child(0)?;
1000 if arg.kind() == "parenthesized_expression" {
1001 arg = arg.named_child(0)?;
1002 }
1003 if arg.kind() == "binary_expression" {
1004 return self.php_directory_include_path(arg);
1005 }
1006 self.php_literal_text(arg).map(str::to_string)
1007 }
1008
1009 /// phpLiteralText: a `string` / `encapsed_string` whose named children
1010 /// 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