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)
| 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 |