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/script_alias_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/script_alias_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/script_alias_command.rs | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/crates/shirabe/src/command/script_alias_command.rs b/crates/shirabe/src/command/script_alias_command.rs index 01a420a..e077bc7 100644 --- a/crates/shirabe/src/command/script_alias_command.rs +++ b/crates/shirabe/src/command/script_alias_command.rs @@ -1,23 +1,20 @@ //! ref: composer/src/Composer/Command/ScriptAliasCommand.php +use crate::command::base_command::{BaseCommand, BaseCommandData, HasBaseCommandData}; +use crate::composer::Composer; use crate::console::input::input_argument::InputArgument; use crate::console::input::input_option::InputOption; use crate::io::io_interface::IOInterface; use crate::util::platform::Platform; -use crate::{command::base_command::BaseCommand, composer::Composer}; use anyhow::Result; use shirabe_external_packages::composer::pcre::preg::Preg; -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; use shirabe_php_shim::{InvalidArgumentException, LogicException, PhpMixed, is_string}; #[derive(Debug)] pub struct ScriptAliasCommand { - inner: CommandBase, - composer: Option<Composer>, - io: Option<Box<dyn IOInterface>>, + base_command_data: BaseCommandData, script: String, description: String, @@ -53,8 +50,7 @@ impl ScriptAliasCommand { } pub fn configure(&mut self) { - self.inner - .set_name(&self.script) + self.set_name(&self.script) .set_description(&self.description) .set_aliases(self.aliases.clone()) .set_definition(vec![ @@ -64,7 +60,6 @@ impl ScriptAliasCommand { Some(InputOption::VALUE_NONE), "Sets the dev mode.", None, - vec![], ), InputOption::new( "no-dev", @@ -72,14 +67,12 @@ impl ScriptAliasCommand { Some(InputOption::VALUE_NONE), "Disables the dev mode.", None, - vec![], ), InputArgument::new( "args", Some(InputArgument::IS_ARRAY | InputArgument::OPTIONAL), "", None, - vec![], ), ]) .set_help( @@ -94,7 +87,7 @@ impl ScriptAliasCommand { input: &dyn InputInterface, _output: &dyn OutputInterface, ) -> Result<i64> { - let composer = self.inner.require_composer()?; + let composer = self.require_composer(None, None)?; let args = input.get_arguments(); @@ -133,30 +126,12 @@ impl ScriptAliasCommand { } } -impl BaseCommand for ScriptAliasCommand { - fn inner(&self) -> &CommandBase { - &self.inner +impl HasBaseCommandData for ScriptAliasCommand { + 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 ScriptAliasCommand {} |
