Build a classmap by scanning all `.php` files under the given directories. Each directory is walked recursively using the `ignore` crate for gitignore-aware traversal. Hidden directories (`.git`, `.idea`, etc.) are skipped automatically. Directories in `.gitignore` are also skipped. Any directory whose absolute path is in `vendor_dir_paths` is explicitly skipped regardless of `.gitignore`. Fi
(
dirs: &[PathBuf],
vendor_dir_paths: &[PathBuf],
)
| 165 | /// names to the absolute file path where they are defined. When a |
| 166 | /// class name appears in multiple files, the first occurrence wins. |
| 167 | pub fn scan_directories( |
| 168 | dirs: &[PathBuf], |
| 169 | vendor_dir_paths: &[PathBuf], |
| 170 | ) -> HashMap<String, PathBuf> { |
| 171 | let mut php_files: Vec<PathBuf> = Vec::new(); |
| 172 | let skip_paths = HashSet::new(); |
| 173 | for dir in dirs { |
| 174 | if !dir.is_dir() { |
| 175 | continue; |
| 176 | } |
| 177 | collect_php_files(dir, vendor_dir_paths, &skip_paths, &mut php_files); |
| 178 | } |
| 179 | scan_files_parallel_classes(&php_files) |
| 180 | } |
| 181 | |
| 182 | /// Build a classmap by scanning all `.php` files under the given |
| 183 | /// directories, applying PSR-4 compliance filtering. |