From fe15d4dba4530f574856a6c443a3f665aa5abe7a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 00:15:52 +0900 Subject: feat(console): implement get_command_name_before_binding via input clone Replace the todo!() stub with the real Symfony logic: clone the input, bind it against the application definition (ignoring binding errors), and read the first argument so the command name is detected even when global options precede it. Add a dup() method to InputInterface to model PHP's clone, derive Clone on the input types, and treat InvalidArgument/InvalidOption/MissingInput as ignorable ExceptionInterface errors during the pre-binding probe. --- .../src/symfony/console/input/input_interface.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs') diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs index d271845..09ffd26 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs @@ -2,6 +2,9 @@ use crate::symfony::console::input::input_definition::InputDefinition; use shirabe_php_shim::PhpMixed; pub trait InputInterface: std::fmt::Debug + shirabe_php_shim::AsAny { + /// Models PHP's `clone` operatior. + fn dup(&self) -> std::rc::Rc>; + fn get_first_argument(&self) -> Option; fn has_parameter_option(&self, values: PhpMixed, only_params: bool) -> bool; -- cgit v1.3.1