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

Function scan_file

src/classmap_scanner.rs:106–114  ·  view source on GitHub ↗

Scan a single PHP file and return the fully-qualified class names it defines. Returns an empty `Vec` when the file cannot be read, is empty, or contains no class-like declarations.

(path: &Path)

Source from the content-addressed store, hash-verified

104/// Returns an empty `Vec` when the file cannot be read, is empty, or
105/// contains no class-like declarations.
106pub fn scan_file(path: &Path) -> Vec<String> {
107 let Ok(content) = std::fs::read(path) else {
108 return Vec::new();
109 };
110 if content.is_empty() {
111 return Vec::new();
112 }
113 find_classes(&content)
114}
115
116/// Scan already-loaded file content and return the fully-qualified class
117/// names it defines.

Callers

nothing calls this directly

Calls 2

find_classesFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected