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

Method push_php_use_ref

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

pushPhpUseRef (3563): `Foo\Bar\Baz` → an `imports` ref named `Foo\Bar::Baz`; a global-namespace name (no `\` after stripping one leading `\`) emits nothing here.

(&mut self, fqn: &str, from_row: u32, node: Node)

Source from the content-addressed store, hash-verified

851 /// `Foo\Bar::Baz`; a global-namespace name (no `\` after stripping one
852 /// leading `\`) emits nothing here.
853 fn push_php_use_ref(&mut self, fqn: &str, from_row: u32, node: Node) {
854 let clean = fqn.strip_prefix('\\').unwrap_or(fqn);
855 let Some(last_sep) = clean.rfind('\\') else { return };
856 let name = format!("{}::{}", &clean[..last_sep], &clean[last_sep + 1..]);
857 self.push_ref_at(from_row, &name, edge_kind_index("imports").unwrap(), node);
858 }
859
860 fn extract_import(&mut self, node: Node<'t>) {
861 let kind = node.kind();

Callers 1

extract_importMethod · 0.80

Calls 3

edge_kind_indexFunction · 0.85
unwrapMethod · 0.60
push_ref_atMethod · 0.45

Tested by

no test coverage detected