From 5d4f18559c2d07c8f05d6585ffc06866411c5a0f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 11 Jul 2026 14:32:06 +0900 Subject: refactor(application): inline plugin command warning writes Buffering warnings into a Vec was a stale Phase B workaround for a borrow conflict that no longer exists now that io is a separately cloned Rc> handle; write them directly in the loop like the original PHP does. --- crates/shirabe/src/console/application.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'crates/shirabe/src/console') diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index 379add75..5591c84b 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -2157,10 +2157,6 @@ impl ApplicationHandle { } } - // TODO(phase-b): the original PHP catches plugin discovery exceptions in a - // try/catch. The Rust port keeps the loop but skips IO error reporting - // because get_plugin_commands borrows &mut self, conflicting with io. - let mut plugin_warnings: Vec = Vec::new(); match (|| -> anyhow::Result<()> { let plugin_commands = application.borrow_mut().get_plugin_commands()?; for command in plugin_commands { @@ -2170,7 +2166,7 @@ impl ApplicationHandle { // name. Plugin command discovery (get_plugin_commands) is unimplemented, so // this loop never runs; wire the concrete class name with the plugin API. let cls = String::new(); - plugin_warnings.push(format!("Plugin command {} ({}) would override a Composer command and has been skipped", cmd_name, cls)); + io.write_error(&format!("Plugin command {} ({}) would override a Composer command and has been skipped", cmd_name, cls)); } else { // Compatibility layer for symfony/console <7.4 // TODO(phase-c): registering a plugin command needs the Symfony @@ -2201,9 +2197,6 @@ impl ApplicationHandle { } } } - for warning in &plugin_warnings { - io.write_error(warning); - } application.borrow_mut().has_plugin_commands = true; } -- cgit v1.3.1