From d5b313f388d424e60ae33ae58c1a65a65b24b8f1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 18:04:45 +0900 Subject: refactor(command): share Input/OutputInterface via Rc Convert InputInterface and OutputInterface parameters from &dyn/&mut dyn references to Rc> shared ownership across the command, console, and IO layers, matching the Phase C shared-ownership approach already used for IOInterface. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/script_alias_command.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/command/script_alias_command.rs') diff --git a/crates/shirabe/src/command/script_alias_command.rs b/crates/shirabe/src/command/script_alias_command.rs index 6499002..7c6e9fb 100644 --- a/crates/shirabe/src/command/script_alias_command.rs +++ b/crates/shirabe/src/command/script_alias_command.rs @@ -93,15 +93,15 @@ impl ScriptAliasCommand { pub fn execute( &mut self, - input: &dyn InputInterface, - _output: &dyn OutputInterface, + input: std::rc::Rc>, + _output: std::rc::Rc>, ) -> Result { let composer = self.require_composer(None, None)?; let dispatcher = crate::command::composer_full(&composer) .get_event_dispatcher() .clone(); - let args = input.get_arguments(); + let args = input.borrow().get_arguments(); // TODO(phase-b): InputInterface has_to_string/get_class_name not modeled in Rust // TODO remove for Symfony 6+ as it is then in the interface @@ -113,8 +113,12 @@ impl ScriptAliasCommand { .into()); } - let dev_mode = input.get_option("dev").as_bool().unwrap_or(false) - || !input.get_option("no-dev").as_bool().unwrap_or(false); + let dev_mode = input.borrow().get_option("dev").as_bool().unwrap_or(false) + || !input + .borrow() + .get_option("no-dev") + .as_bool() + .unwrap_or(false); Platform::put_env("COMPOSER_DEV_MODE", if dev_mode { "1" } else { "0" }); -- cgit v1.3.1