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

Method extract_inheritance

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

1173 /// multi-extends drops the rest); class_interface_clause takes ALL
1174 /// children unfiltered (full text, incl. leading `\`).
1175 fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) {
1176 let extends_kind = edge_kind_index("extends").unwrap();
1177 let implements_kind = edge_kind_index("implements").unwrap();
1178 for i in 0..node.named_child_count() {
1179 let Some(child) = node.named_child(i) else { continue };
1180 if child.kind() == "base_clause" {
1181 if let Some(target) = child.named_child(0) {
1182 let name = self.text(target).to_string();
1183 self.push_ref_at(class_row, &name, extends_kind, target);
1184 }
1185 } else if child.kind() == "class_interface_clause" {
1186 for j in 0..child.named_child_count() {
1187 let Some(iface) = child.named_child(j) else { continue };
1188 let name = self.text(iface).to_string();
1189 self.push_ref_at(class_row, &name, implements_kind, iface);
1190 }
1191 }
1192 }
1193 }
1194
1195 // --- php type refs (extractPhpTypeRefs, 6022) ----------------------------------
1196

Callers 3

extract_classMethod · 0.45
extract_interfaceMethod · 0.45
extract_enumMethod · 0.45

Calls 4

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

Tested by

no test coverage detected