diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-02 11:13:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-02 11:13:00 +0900 |
| commit | caf8dee0c73a7a680d93bf943cade43632e74ca7 (patch) | |
| tree | cf5913d7a885ff3cca0b5c5ddf630e492a0f5e31 /crates/shirabe/src/command | |
| parent | 145b4c0a7fadf6dfd8c03b22c735695037930b0a (diff) | |
| download | php-shirabe-caf8dee0c73a7a680d93bf943cade43632e74ca7.tar.gz php-shirabe-caf8dee0c73a7a680d93bf943cade43632e74ca7.tar.zst php-shirabe-caf8dee0c73a7a680d93bf943cade43632e74ca7.zip | |
feat(symfony-console): restore CompletionInput's ArgvInput inheritance surface
PHP's CompletionInput extends ArgvInput, so it can be passed anywhere an
InputInterface is expected (GlobalCommand::complete binds and forwards it,
suggestion closures read options and arguments from it). The Rust port only
embedded the ArgvInput, so none of that surface was reachable.
Implement InputInterface by forwarding to the embedded ArgvInput, with bind
dispatching to the specialized CompletionInput::bind (PHP's virtual
dispatch), derive Clone, and teach GlobalCommand::input_to_string the
CompletionInput branch.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command')
| -rw-r--r-- | crates/shirabe/src/command/global_command.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/shirabe/src/command/global_command.rs b/crates/shirabe/src/command/global_command.rs index e70a2082..0414fd76 100644 --- a/crates/shirabe/src/command/global_command.rs +++ b/crates/shirabe/src/command/global_command.rs @@ -10,6 +10,7 @@ use crate::util::Filesystem; use crate::util::Platform; use shirabe_external_packages::composer::pcre::Preg; use shirabe_external_packages::symfony::console::command::command::Command; +use shirabe_external_packages::symfony::console::completion::completion_input::CompletionInput; use shirabe_external_packages::symfony::console::input::ArgvInput; use shirabe_external_packages::symfony::console::input::ArrayInput; use shirabe_external_packages::symfony::console::input::InputInterface; @@ -54,6 +55,8 @@ impl GlobalCommand { Ok(array_input.to_string()) } else if let Some(string_input) = input_any.downcast_ref::<StringInput>() { Ok(string_input.to_string()) + } else if let Some(completion_input) = input_any.downcast_ref::<CompletionInput>() { + Ok(completion_input.to_string()) } else { Err(LogicException { message: "Expected an Input instance that is stringable".to_string(), |
