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

Method extract_inheritance

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

extractInheritance — base_clause takes ONLY the first base (interface multi-extends drops the rest); class_interface_clause takes ALL children unfiltered (full text, incl. leading `\`).

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

Source from the content-addressed store, hash-verified

1314 /// multi-extends drops the rest); class_interface_clause takes ALL
1315 /// children unfiltered (full text, incl. leading `\`).
1316 fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) {
1317 let extends_kind = edge_kind_index("extends").unwrap();
1318 let implements_kind = edge_kind_index("implements").unwrap();
1319 for child in node.named_children(&mut node.walk()) {
1320 if child.kind() == "base_clause" {
1321 if let Some(target) = child.named_child(0) {
1322 let name = self.text(target).to_string();
1323 self.push_ref_at(class_row, &name, extends_kind, target);
1324 }
1325 } else if child.kind() == "class_interface_clause" {
1326 for iface in child.named_children(&mut child.walk()) {
1327 let name = self.text(iface).to_string();
1328 self.push_ref_at(class_row, &name, implements_kind, iface);
1329 }
1330 }
1331 }
1332 }
1333
1334 // --- php type refs (extractPhpTypeRefs, 6022) ----------------------------------
1335

Callers 3

extract_classMethod · 0.45
extract_interfaceMethod · 0.45
extract_enumMethod · 0.45

Calls 5

edge_kind_indexFunction · 0.85
textMethod · 0.65
unwrapMethod · 0.60
walkMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected