aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-11 14:32:06 +0900
committernsfisis <nsfisis@gmail.com>2026-07-11 14:32:06 +0900
commit5d4f18559c2d07c8f05d6585ffc06866411c5a0f (patch)
tree8392291ab7a96e11deb4fa32e3d7836444d3fc88
parent058b85b641f806702031dca60d4b84d90aaef452 (diff)
downloadphp-shirabe-5d4f18559c2d07c8f05d6585ffc06866411c5a0f.tar.gz
php-shirabe-5d4f18559c2d07c8f05d6585ffc06866411c5a0f.tar.zst
php-shirabe-5d4f18559c2d07c8f05d6585ffc06866411c5a0f.zip
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<RefCell<dyn IOInterface>> handle; write them directly in the loop like the original PHP does.
-rw-r--r--crates/shirabe/src/console/application.rs9
1 files changed, 1 insertions, 8 deletions
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<String> = 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!("<warning>Plugin command {} ({}) would override a Composer command and has been skipped</warning>", cmd_name, cls));
+ io.write_error(&format!("<warning>Plugin command {} ({}) would override a Composer command and has been skipped</warning>", 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;
}