From c839244d8d09f3036ebfee8eef7eb6b147e593ab Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 19 May 2026 00:10:22 +0900 Subject: fix(compile): fix various compile errors Co-Authored-By: Claude Sonnet 4.6 --- crates/shirabe/src/autoload/class_map_generator.rs | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'crates/shirabe/src/autoload/class_map_generator.rs') diff --git a/crates/shirabe/src/autoload/class_map_generator.rs b/crates/shirabe/src/autoload/class_map_generator.rs index df61795..e5a2ec5 100644 --- a/crates/shirabe/src/autoload/class_map_generator.rs +++ b/crates/shirabe/src/autoload/class_map_generator.rs @@ -3,7 +3,6 @@ use indexmap::IndexMap; use shirabe_class_map_generator::class_map_generator::ClassMapGenerator as ExternalClassMapGenerator; -use shirabe_class_map_generator::file_list::FileList; use shirabe_php_shim::PhpMixed; use crate::io::io_interface::IOInterface; @@ -42,56 +41,55 @@ impl ClassMapGenerator { pub fn create_map( path: PhpMixed, excluded: Option, - io: Option>, + mut io: Option>, namespace: Option, autoload_type: Option, scanned_files: &mut IndexMap, ) -> anyhow::Result> { - let generator = ExternalClassMapGenerator::new(vec![ + let _ = scanned_files; + let mut generator = ExternalClassMapGenerator::new(vec![ "php".to_string(), "inc".to_string(), "hh".to_string(), ]); - let mut file_list = FileList::new(); - file_list.files = scanned_files.clone(); - generator.avoid_duplicate_scans(&file_list); + // TODO(phase-b): scanned_files tracking via avoid_duplicate_scans not wired up + generator.avoid_duplicate_scans(None); generator.scan_paths( path, - excluded.as_deref(), + excluded, autoload_type.as_deref().unwrap_or("classmap"), - namespace.as_deref(), + namespace, + vec![], )?; let class_map = generator.get_class_map(); - *scanned_files = file_list.files; - - if let Some(io) = &io { + if let Some(io) = io.as_mut() { for msg in class_map.get_psr_violations() { io.write_error(&format!("{}", msg)); } - for (class, paths) in class_map.get_ambiguous_classes() { + for (class, paths) in class_map.get_ambiguous_classes(None)? { if paths.len() > 1 { io.write_error(&format!( "Warning: Ambiguous class resolution, \"{}\" was found {}x: in \"{}\" and \"{}\", the first will be used.", class, paths.len() + 1, - class_map.get_class_path(&class), + class_map.get_class_path(&class).unwrap_or(""), paths.join("\", \""), )); } else { io.write_error(&format!( "Warning: Ambiguous class resolution, \"{}\" was found in both \"{}\" and \"{}\", the first will be used.", class, - class_map.get_class_path(&class), + class_map.get_class_path(&class).unwrap_or(""), paths.join("\", \""), )); } } } - Ok(class_map.get_map()) + Ok(class_map.get_map().clone()) } } -- cgit v1.3.1