diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:43 +0900 |
| commit | 1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch) | |
| tree | 9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe/src/command/base_dependency_command.rs | |
| parent | ddf0a624145b618c05c2ee47414545b99b685f37 (diff) | |
| download | php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.gz php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.zst php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.zip | |
feat(symfony-console): port Symfony Console and make the workspace compile
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/base_dependency_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/base_dependency_command.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/shirabe/src/command/base_dependency_command.rs b/crates/shirabe/src/command/base_dependency_command.rs index 27f3544..1ca8a76 100644 --- a/crates/shirabe/src/command/base_dependency_command.rs +++ b/crates/shirabe/src/command/base_dependency_command.rs @@ -59,7 +59,7 @@ pub trait BaseDependencyCommand: BaseCommand { if input .borrow() - .get_option("locked") + .get_option("locked")? .as_bool() .unwrap_or(false) { @@ -94,7 +94,7 @@ pub trait BaseDependencyCommand: BaseCommand { && (root_pkg.get_requires().len() > 0 || root_pkg.get_dev_requires().len() > 0) { output.borrow().writeln( - "<warning>No dependencies installed. Try running composer install or update, or use --locked.</warning>", + &["<warning>No dependencies installed. Try running composer install or update, or use --locked.</warning>".to_string()], shirabe_external_packages::symfony::console::output::OUTPUT_NORMAL, ); @@ -122,14 +122,14 @@ pub trait BaseDependencyCommand: BaseCommand { let needle = input .borrow() - .get_argument(Self::ARGUMENT_PACKAGE) + .get_argument(Self::ARGUMENT_PACKAGE)? .as_string() .unwrap_or_default() .to_string(); let text_constraint: String = if input.borrow().has_argument(Self::ARGUMENT_CONSTRAINT) { input .borrow() - .get_argument(Self::ARGUMENT_CONSTRAINT) + .get_argument(Self::ARGUMENT_CONSTRAINT)? .as_string() .unwrap_or("*") .to_string() @@ -246,13 +246,13 @@ pub trait BaseDependencyCommand: BaseCommand { let render_tree = input .borrow() - .get_option(Self::OPTION_TREE) + .get_option(Self::OPTION_TREE)? .as_bool() .unwrap_or(false); let recursive = render_tree || input .borrow() - .get_option(Self::OPTION_RECURSIVE) + .get_option(Self::OPTION_RECURSIVE)? .as_bool() .unwrap_or(false); @@ -357,7 +357,7 @@ pub trait BaseDependencyCommand: BaseCommand { let name_with_link = match &package_url { Some(url) => format!( "<href={}>{}</>", - OutputFormatter::escape(url), + OutputFormatter::escape(url).expect("OutputFormatter::escape never fails"), package.get_pretty_name() ), None => package.get_pretty_name().to_string(), @@ -399,12 +399,12 @@ pub trait BaseDependencyCommand: BaseCommand { "blue".to_string(), ]; for color in self.colors() { - let style = OutputFormatterStyle::new(Some(color), None, None); + let style = OutputFormatterStyle::new(Some(color), None, vec![]); output .borrow() .get_formatter() .borrow_mut() - .set_style(color, style); + .set_style(color, Box::new(style)); } } @@ -428,7 +428,7 @@ pub trait BaseDependencyCommand: BaseCommand { let name_with_link = match &package_url { Some(url) => format!( "<href={}>{}</>", - OutputFormatter::escape(url), + OutputFormatter::escape(url).expect("OutputFormatter::escape never fails"), package.get_pretty_name() ), None => package.get_pretty_name().to_string(), |
