From 6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 11 Jun 2026 02:39:35 +0900 Subject: feat(console): resolve phase-b TODOs in doRun and IO wiring Wire up ConsoleIO with HelperSet/QuestionHelper, register the ErrorHandler with the IO instance, and fall back to a default output in run(). Replace resolved phase-b TODOs across the console, command, io, factory, installer, dependency_resolver, and util modules; reclassify the remaining blockers (typed Symfony command registry, stdin resource caching) as phase-c. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/run_script_command.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/command/run_script_command.rs') diff --git a/crates/shirabe/src/command/run_script_command.rs b/crates/shirabe/src/command/run_script_command.rs index ce072e4..9a28b5f 100644 --- a/crates/shirabe/src/command/run_script_command.rs +++ b/crates/shirabe/src/command/run_script_command.rs @@ -190,9 +190,19 @@ impl RunScriptCommand { .get_option("no-dev") .as_bool() .unwrap_or(false); - // TODO(phase-b): ScriptEvent::new takes Composer/IOInterface by value; placeholder construction. - let _ = (script.clone(), &composer, dev_mode); - let has_listeners = false; + let io = self.get_io(); + let event = ScriptEvent::new( + script.clone(), + composer + .as_full() + .expect("require_composer returns a full Composer") + .downgrade(), + io, + dev_mode, + vec![], + IndexMap::new(), + ); + let has_listeners = dispatcher.borrow_mut().has_event_listeners(&event); if !has_listeners { return Err(InvalidArgumentException { message: format!("Script \"{}\" is not defined in this package", script), @@ -272,7 +282,11 @@ impl RunScriptCommand { let mut result: Vec<(String, String)> = vec![]; for (name, _script) in scripts { - // TODO(phase-b): Application::find returns PhpMixed; placeholder description. + // PHP: $cmd = $this->getApplication()->find($name); $description = $cmd->getDescription(); + // TODO(phase-c): Application::find returns PhpMixed (the Symfony command registry is a + // todo!() stub) and get_application() is itself deferred, so the resolved command's + // getDescription() cannot be read; the description stays empty until the typed command + // registry is modelled. let _ = self.get_application()?.find(&name); let description = String::new(); result.push((name, description)); -- cgit v1.3.1