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

Method find_or_load_class

src/resolution.rs:57–62  ·  view source on GitHub ↗

Try to find a class by name across all cached files in the uri_classes_index, and if not found, attempt PSR-4 resolution to load the class from disk. The `class_name` can be: - A simple name like `"Customer"` - A namespace-qualified name like `"Klarna\\Customer"` - A fully-qualified name like `"\\Klarna\\Customer"` (leading `\` is stripped) Returns a shared `Arc ` if found, or `None`.

(&self, class_name: &str)

Source from the content-addressed store, hash-verified

55 ///
56 /// Returns a shared `Arc<ClassInfo>` if found, or `None`.
57 pub(crate) fn find_or_load_class(&self, class_name: &str) -> Option<Arc<ClassInfo>> {
58 // Defensively strip nullable prefix (`?Foo` → `Foo`) and generic
59 // parameters (`Collection<int, User>` → `Collection`) so that
60 // callers don't need to normalise before lookup.
61 self.find_or_load_class_typed(&PhpType::parse(class_name))
62 }
63
64 /// Like [`find_or_load_class`], but accepts a pre-parsed `PhpType`,
65 /// avoiding the redundant `PhpType::parse()` call that the string

Callers 15

runFunction · 0.80
resolve_class_nameMethod · 0.80
class_loader_withMethod · 0.80
find_prototypeMethod · 0.80
supertypes_implMethod · 0.80

Calls 1