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

Method push_php_use_ref

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

877 /// `Foo\Bar::Baz`; a global-namespace name (no `\` after stripping one
878 /// leading `\`) emits nothing here.
879 fn push_php_use_ref(&mut self, fqn: &str, from_row: u32, node: Node) {
880 let clean = fqn.strip_prefix('\\').unwrap_or(fqn);
881 let Some(last_sep) = clean.rfind('\\') else { return };
882 let name = format!("{}::{}", &clean[..last_sep], &clean[last_sep + 1..]);
883 self.push_ref_at(from_row, &name, edge_kind_index("imports").unwrap(), node);
884 }
885
886 fn extract_import(&mut self, node: Node<'t>) {
887 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