MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / interface_dependency

Function interface_dependency

src/toposort.rs:301–317  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299
300 #[test]
301 fn interface_dependency() {
302 let iface = make_class("MyInterface");
303 let mut c = make_class("MyClass");
304 c.interfaces = vec![crate::atom::atom("MyInterface")];
305
306 let classes = vec![
307 ("MyClass".to_string(), &c),
308 ("MyInterface".to_string(), &iface),
309 ];
310
311 let sorted = toposort_classes(classes.into_iter());
312
313 let pos_i = sorted.iter().position(|s| s == "MyInterface").unwrap();
314 let pos_c = sorted.iter().position(|s| s == "MyClass").unwrap();
315
316 assert!(pos_i < pos_c, "MyInterface must come before MyClass");
317 }
318
319 #[test]
320 fn mixin_dependency() {

Callers

nothing calls this directly

Calls 5

toposort_classesFunction · 0.85
into_iterMethod · 0.80
iterMethod · 0.80
make_classFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected