diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:10:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:11:03 +0900 |
| commit | c839244d8d09f3036ebfee8eef7eb6b147e593ab (patch) | |
| tree | fe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/command/about_command.rs | |
| parent | 48839250146b217e2756ed3c0e624fd341b54d6c (diff) | |
| download | php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip | |
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/about_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/about_command.rs | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/crates/shirabe/src/command/about_command.rs b/crates/shirabe/src/command/about_command.rs index f2fdb80..0503578 100644 --- a/crates/shirabe/src/command/about_command.rs +++ b/crates/shirabe/src/command/about_command.rs @@ -1,32 +1,30 @@ //! ref: composer/src/Composer/Command/AboutCommand.php use crate::command::base_command::BaseCommand; +use crate::command::base_command::BaseCommandData; +use crate::command::base_command::HasBaseCommandData; use crate::composer::Composer; use crate::io::io_interface::IOInterface; -use shirabe_external_packages::symfony::component::console::command::command::Command; -use shirabe_external_packages::symfony::component::console::command::command::CommandBase; use shirabe_external_packages::symfony::console::input::input_interface::InputInterface; use shirabe_external_packages::symfony::console::output::output_interface::OutputInterface; #[derive(Debug)] pub struct AboutCommand { - inner: CommandBase, - composer: Option<Composer>, - io: Option<Box<dyn IOInterface>>, + base_command_data: BaseCommandData, } impl AboutCommand { pub fn configure(&mut self) { - self.inner - .set_name("about") + self.set_name("about") .set_description("Shows a short information about Composer") .set_help("<info>php composer.phar about</info>"); } - pub fn execute(&self, input: &dyn InputInterface, output: &dyn OutputInterface) -> i64 { + pub fn execute(&mut self, input: &dyn InputInterface, output: &dyn OutputInterface) -> i64 { let composer_version = Composer::get_version(); + let _ = (input, output); - self.inner.get_io().write(&format!( + self.get_io().write(&format!( "<info>Composer - Dependency Manager for PHP - version {composer_version}</info>\n\ <comment>Composer is a dependency manager tracking local dependencies of your projects and libraries.\n\ See https://getcomposer.org/ for more information.</comment>" @@ -36,30 +34,12 @@ impl AboutCommand { } } -impl BaseCommand for AboutCommand { - fn inner(&self) -> &CommandBase { - &self.inner +impl HasBaseCommandData for AboutCommand { + fn base_command_data(&self) -> &BaseCommandData { + &self.base_command_data } - fn inner_mut(&mut self) -> &mut CommandBase { - &mut self.inner - } - - fn composer(&self) -> Option<&Composer> { - self.composer.as_ref() - } - - fn composer_mut(&mut self) -> &mut Option<Composer> { - &mut self.composer - } - - fn io(&self) -> Option<&dyn IOInterface> { - self.io.as_deref() - } - - fn io_mut(&mut self) -> &mut Option<Box<dyn IOInterface>> { - &mut self.io + fn base_command_data_mut(&mut self) -> &mut BaseCommandData { + &mut self.base_command_data } } - -impl Command for AboutCommand {} |
