diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 14:33:13 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 14:38:16 +0900 |
| commit | 3e21569688cf0c8a1918c73ff96cb1b3aeffe0b3 (patch) | |
| tree | 712ae7832124da20739f5b389cebe4f44abd7225 /crates/shirabe/src/command | |
| parent | ac59538140a93d9a023da2115148bc9779223978 (diff) | |
| download | php-shirabe-3e21569688cf0c8a1918c73ff96cb1b3aeffe0b3.tar.gz php-shirabe-3e21569688cf0c8a1918c73ff96cb1b3aeffe0b3.tar.zst php-shirabe-3e21569688cf0c8a1918c73ff96cb1b3aeffe0b3.zip | |
fix(compile): extract constants from traits to make them dyn-compatible
Diffstat (limited to 'crates/shirabe/src/command')
| -rw-r--r-- | crates/shirabe/src/command/bump_command.rs | 23 | ||||
| -rw-r--r-- | crates/shirabe/src/command/completion_trait.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/src/command/config_command.rs | 7 | ||||
| -rw-r--r-- | crates/shirabe/src/command/init_command.rs | 25 | ||||
| -rw-r--r-- | crates/shirabe/src/command/package_discovery_trait.rs | 13 | ||||
| -rw-r--r-- | crates/shirabe/src/command/require_command.rs | 29 | ||||
| -rw-r--r-- | crates/shirabe/src/command/search_command.rs | 10 | ||||
| -rw-r--r-- | crates/shirabe/src/command/self_update_command.rs | 65 | ||||
| -rw-r--r-- | crates/shirabe/src/command/update_command.rs | 17 |
9 files changed, 101 insertions, 94 deletions
diff --git a/crates/shirabe/src/command/bump_command.rs b/crates/shirabe/src/command/bump_command.rs index 0382246..d608a4c 100644 --- a/crates/shirabe/src/command/bump_command.rs +++ b/crates/shirabe/src/command/bump_command.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/BumpCommand.php +use crate::io::io_interface; use anyhow::Result; use shirabe_external_packages::composer::pcre::preg::Preg; use shirabe_external_packages::symfony::component::console::command::command::Command; @@ -109,7 +110,7 @@ impl BumpCommand { composer_json_path )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(Self::ERROR_GENERIC); } @@ -124,7 +125,7 @@ impl BumpCommand { composer_json_path )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(Self::ERROR_GENERIC); } @@ -144,7 +145,7 @@ impl BumpCommand { composer_json_path )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(Self::ERROR_GENERIC); } @@ -161,7 +162,7 @@ impl BumpCommand { "<error>The lock file is not up to date with the latest changes in composer.json. Run the appropriate `update` to fix that before you use the `bump` command.</error>".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(Self::ERROR_LOCK_OUTDATED); } @@ -176,7 +177,7 @@ impl BumpCommand { "<warning>Warning: Bumping dependency constraints is not recommended for libraries as it will narrow down your dependencies and may cause problems for your users.</warning>".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let contents_data = composer_json.read()?; @@ -186,7 +187,7 @@ impl BumpCommand { "If your package is not a library, you can explicitly specify the \"type\" by using \"composer config type project\".".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); io.write_error( PhpMixed::String(format!( @@ -194,7 +195,7 @@ impl BumpCommand { dev_only_flag_hint )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } @@ -286,7 +287,7 @@ impl BumpCommand { composer_json_path )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); for (require_type, packages) in &updates { for (package, version) in packages { @@ -296,7 +297,7 @@ impl BumpCommand { require_type, package, version )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } @@ -307,7 +308,7 @@ impl BumpCommand { composer_json_path, change_count )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } else { @@ -317,7 +318,7 @@ impl BumpCommand { composer_json_path )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } diff --git a/crates/shirabe/src/command/completion_trait.rs b/crates/shirabe/src/command/completion_trait.rs index 8278603..ea2db2b 100644 --- a/crates/shirabe/src/command/completion_trait.rs +++ b/crates/shirabe/src/command/completion_trait.rs @@ -6,7 +6,7 @@ use crate::package::package_interface::PackageInterface; use crate::repository::composite_repository::CompositeRepository; use crate::repository::installed_repository::InstalledRepository; use crate::repository::platform_repository::PlatformRepository; -use crate::repository::repository_interface::RepositoryInterface; +use crate::repository::repository_interface::{self, RepositoryInterface}; use crate::repository::root_package_repository::RootPackageRepository; use shirabe_external_packages::composer::pcre::preg::Preg; use shirabe_external_packages::symfony::component::console::completion::completion_input::CompletionInput; @@ -179,7 +179,7 @@ pub trait CompletionTrait { if !input.get_completion_value().contains('/') { let search_results = repos.search( format!("^{}", preg_quote(input.get_completion_value(), None)), - RepositoryInterface::SEARCH_VENDOR, + repository_interface::SEARCH_VENDOR, None, ); results = search_results.iter().map(|r| r.name.clone()).collect(); @@ -192,7 +192,7 @@ pub trait CompletionTrait { if results.len() <= 1 { let search_results = repos.search( format!("^{}", preg_quote(input.get_completion_value(), None)), - RepositoryInterface::SEARCH_NAME, + repository_interface::SEARCH_NAME, None, ); results = search_results.iter().map(|r| r.name.clone()).collect(); diff --git a/crates/shirabe/src/command/config_command.rs b/crates/shirabe/src/command/config_command.rs index 62e630a..a539d69 100644 --- a/crates/shirabe/src/command/config_command.rs +++ b/crates/shirabe/src/command/config_command.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/ConfigCommand.php +use crate::io::io_interface; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::preg::Preg; @@ -483,7 +484,7 @@ impl ConfigCommand { self.inner.inner.get_io().write( &format!("{}{}", value_str, source_of_config_value), true, - IOInterface::QUIET, + io_interface::QUIET, ); return Ok(0); @@ -1364,7 +1365,7 @@ impl ConfigCommand { source ), true, - IOInterface::QUIET, + io_interface::QUIET, ); } else { io.write( @@ -1377,7 +1378,7 @@ impl ConfigCommand { source ), true, - IOInterface::QUIET, + io_interface::QUIET, ); } } diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs index d8f0113..b43fdea 100644 --- a/crates/shirabe/src/command/init_command.rs +++ b/crates/shirabe/src/command/init_command.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/InitCommand.php +use crate::io::io_interface; use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::preg::Preg; @@ -271,7 +272,7 @@ impl InitCommand { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); if !io.ask_confirmation( "Do you confirm generation [<comment>yes</comment>]? ".to_string(), @@ -280,7 +281,7 @@ impl InitCommand { io.write_error( PhpMixed::String("<error>Command aborted</error>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -289,7 +290,7 @@ impl InitCommand { io.write_error( PhpMixed::String(format!("Writing {}", file_obj.get_path())), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -303,7 +304,7 @@ impl InitCommand { "<error>Schema validation error, aborting</error>".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let errors = format!( " - {}", @@ -312,7 +313,7 @@ impl InitCommand { io.write_error( PhpMixed::String(format!("{}:{}{}", json_err.message, PHP_EOL, errors)), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); Silencer::call( "unlink", @@ -376,7 +377,7 @@ impl InitCommand { autoload_path.as_deref().unwrap_or("") )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); io.write_error( PhpMixed::String( @@ -384,7 +385,7 @@ impl InitCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -493,7 +494,7 @@ impl InitCommand { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); // namespace @@ -507,7 +508,7 @@ impl InitCommand { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let mut name = input @@ -709,7 +710,7 @@ impl InitCommand { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); // prepare to resolve dependencies @@ -1024,7 +1025,7 @@ impl InitCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } @@ -1040,7 +1041,7 @@ impl InitCommand { self.inner.get_io().write_error( PhpMixed::String("Could not run dump-autoload.".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } diff --git a/crates/shirabe/src/command/package_discovery_trait.rs b/crates/shirabe/src/command/package_discovery_trait.rs index 8fcf2c8..164cc53 100644 --- a/crates/shirabe/src/command/package_discovery_trait.rs +++ b/crates/shirabe/src/command/package_discovery_trait.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/PackageDiscoveryTrait.php +use crate::io::io_interface; use std::any::Any; use anyhow::Result; @@ -167,7 +168,7 @@ pub trait PackageDiscoveryTrait { requirement.get("name").map(|s| s.as_str()).unwrap_or(""), )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -198,7 +199,7 @@ pub trait PackageDiscoveryTrait { ], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } else { requirement.insert("version".to_string(), "guess".to_string()); @@ -331,7 +332,7 @@ pub trait PackageDiscoveryTrait { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); io.write_error( @@ -342,9 +343,9 @@ pub trait PackageDiscoveryTrait { .collect(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); - io.write_error(PhpMixed::String(String::new()), true, IOInterface::NORMAL); + io.write_error(PhpMixed::String(String::new()), true, io_interface::NORMAL); let matches_clone = matches.clone(); let version_parser_clone = version_parser.clone(); @@ -440,7 +441,7 @@ pub trait PackageDiscoveryTrait { ], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); c diff --git a/crates/shirabe/src/command/require_command.rs b/crates/shirabe/src/command/require_command.rs index 24dda7e..70c3651 100644 --- a/crates/shirabe/src/command/require_command.rs +++ b/crates/shirabe/src/command/require_command.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/RequireCommand.php +use crate::io::io_interface; use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::preg::Preg; @@ -136,7 +137,7 @@ impl RequireCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -148,7 +149,7 @@ impl RequireCommand { self.file )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -157,7 +158,7 @@ impl RequireCommand { io.write_error( PhpMixed::String(format!("<error>{} is not readable.</error>", self.file)), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -186,7 +187,7 @@ impl RequireCommand { SignalHandler::SIGHUP, ], Box::new(move |signal: String, handler: &SignalHandler| { - // TODO(phase-b): self.get_io().write_error('Received '.$signal.', aborting', true, IOInterface::DEBUG); + // TODO(phase-b): self.get_io().write_error('Received '.$signal.', aborting', true, io_interface::DEBUG); // TODO(phase-b): self.revert_composer_file(); let _ = signal; handler.exit_with_last_signal(); @@ -209,7 +210,7 @@ impl RequireCommand { io.write_error( PhpMixed::String(format!("<error>{} is not writable.</error>", self.file)), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -236,7 +237,7 @@ impl RequireCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); if !config.contains_key("type") { @@ -246,7 +247,7 @@ impl RequireCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -425,7 +426,7 @@ impl RequireCommand { &[PhpMixed::String(package.clone())], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -544,7 +545,7 @@ impl RequireCommand { } )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); if input.get_option("no-update").as_bool().unwrap_or(false) { @@ -817,7 +818,7 @@ impl RequireCommand { flags, )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let command_event = CommandEvent::new(PluginEvents::COMMAND, "require", input, output); @@ -888,7 +889,7 @@ impl RequireCommand { req.get("name").cloned().unwrap_or_default(), )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); break; } @@ -955,7 +956,7 @@ impl RequireCommand { ], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); if Preg::is_match( @@ -1107,7 +1108,7 @@ impl RequireCommand { self.file )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); unlink(self.json.as_ref().unwrap().get_path()); if file_exists(&self.lock) { @@ -1125,7 +1126,7 @@ impl RequireCommand { self.file, msg )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); file_put_contents( self.json.as_ref().unwrap().get_path(), diff --git a/crates/shirabe/src/command/search_command.rs b/crates/shirabe/src/command/search_command.rs index 28f4fd1..3b0d52e 100644 --- a/crates/shirabe/src/command/search_command.rs +++ b/crates/shirabe/src/command/search_command.rs @@ -8,7 +8,7 @@ use crate::plugin::command_event::CommandEvent; use crate::plugin::plugin_events::PluginEvents; use crate::repository::composite_repository::CompositeRepository; use crate::repository::platform_repository::PlatformRepository; -use crate::repository::repository_interface::RepositoryInterface; +use crate::repository::repository_interface::{self, RepositoryInterface}; use crate::{command::base_command::BaseCommand, composer::Composer}; use anyhow::Result; use indexmap::IndexMap; @@ -98,7 +98,7 @@ impl SearchCommand { .get_event_dispatcher() .dispatch(command_event.get_name(), &command_event); - let mut mode: i64 = RepositoryInterface::SEARCH_FULLTEXT; + let mut mode: i64 = repository_interface::SEARCH_FULLTEXT; if input.get_option("only-name").as_bool().unwrap_or(false) { if input.get_option("only-vendor").as_bool().unwrap_or(false) { return Err(InvalidArgumentException { @@ -107,9 +107,9 @@ impl SearchCommand { } .into()); } - mode = RepositoryInterface::SEARCH_NAME; + mode = repository_interface::SEARCH_NAME; } else if input.get_option("only-vendor").as_bool().unwrap_or(false) { - mode = RepositoryInterface::SEARCH_VENDOR; + mode = repository_interface::SEARCH_VENDOR; } let r#type = input @@ -127,7 +127,7 @@ impl SearchCommand { }) .unwrap_or_default(); let mut query = implode(" ", &token_strings); - if mode != RepositoryInterface::SEARCH_FULLTEXT { + if mode != repository_interface::SEARCH_FULLTEXT { query = preg_quote(&query, None); } diff --git a/crates/shirabe/src/command/self_update_command.rs b/crates/shirabe/src/command/self_update_command.rs index b1b0c06..5f80516 100644 --- a/crates/shirabe/src/command/self_update_command.rs +++ b/crates/shirabe/src/command/self_update_command.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/SelfUpdateCommand.php +use crate::io::io_interface; use anyhow::Result; use shirabe_external_packages::composer::pcre::preg::Preg; use shirabe_external_packages::symfony::component::console::command::command::Command; @@ -89,21 +90,21 @@ impl SelfUpdateCommand { "<error>This instance of Composer does not have the self-update command.</error>" .to_string(), ), - IOInterface::NORMAL, + io_interface::NORMAL, ); output.writeln( PhpMixed::String(format!( "<comment>You are running Composer installed as a package in your current project (\"{}\").</comment>", proj_dir )), - IOInterface::NORMAL, + io_interface::NORMAL, ); output.writeln( PhpMixed::String( "<comment>To update Composer, download a composer.phar from https://getcomposer.org and then run `composer.phar update composer/composer` in your project.</comment>" .to_string(), ), - IOInterface::NORMAL, + io_interface::NORMAL, ); } else { output.writeln( @@ -111,14 +112,14 @@ impl SelfUpdateCommand { "<error>This instance of Composer does not have the self-update command.</error>" .to_string(), ), - IOInterface::NORMAL, + io_interface::NORMAL, ); output.writeln( PhpMixed::String( "<comment>This could be due to a number of reasons, such as Composer being installed as a system package on your OS, or Composer being installed as a package in the current project.</comment>" .to_string(), ), - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -245,7 +246,7 @@ impl SelfUpdateCommand { composer_user_name, home, home_owner_name )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } @@ -312,7 +313,7 @@ impl SelfUpdateCommand { skipped_version, update_major_version, update_major_version )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } else if version_compare(¤t_major_version, &preview_major_version, "<") { // promote next major version if available in preview @@ -322,7 +323,7 @@ impl SelfUpdateCommand { latest_preview.get("version").and_then(|v| v.as_string()).unwrap_or("") )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } } @@ -348,7 +349,7 @@ impl SelfUpdateCommand { latest_stable.get("version").and_then(|v| v.as_string()).unwrap_or("") )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } if latest.contains_key("eol") { @@ -359,7 +360,7 @@ impl SelfUpdateCommand { latest_stable.get("version").and_then(|v| v.as_string()).unwrap_or("") )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -372,7 +373,7 @@ impl SelfUpdateCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -393,7 +394,7 @@ impl SelfUpdateCommand { ], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); // remove all backups except for the most recent, if any @@ -437,7 +438,7 @@ impl SelfUpdateCommand { ], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let remote_filename = format!( "{}{}", @@ -467,10 +468,10 @@ impl SelfUpdateCommand { io.write_error( PhpMixed::String(" ".to_string()), false, - IOInterface::NORMAL, + io_interface::NORMAL, ); http_downloader.copy(&remote_filename, &temp_filename)?; - io.write_error(PhpMixed::String(String::new()), true, IOInterface::NORMAL); + io.write_error(PhpMixed::String(String::new()), true, io_interface::NORMAL); if !file_exists(&temp_filename) || signature.is_none() || signature.as_deref() == Some("") { io.write_error( @@ -479,7 +480,7 @@ impl SelfUpdateCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(1); @@ -494,7 +495,7 @@ impl SelfUpdateCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } else { if !extension_loaded("openssl") { @@ -644,7 +645,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ &[PhpMixed::String(Composer::VERSION.to_string())], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } else { io.write_error( @@ -653,7 +654,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ backup_file )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -676,7 +677,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); // TODO(phase-b): closure captures none; PHP throws inside the closure on bad input @@ -741,7 +742,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ Keys::fingerprint(&key_path)? )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let mut tags_key = String::new(); @@ -788,7 +789,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ Keys::fingerprint(&key_path)? )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); io.write( @@ -797,7 +798,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ config.get("home").as_string().unwrap_or("") )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); Ok(()) @@ -862,7 +863,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ &[PhpMixed::String(rollback_version.clone())], )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); if !self.set_local_phar(local_filename, &old_file, None)? { return Ok(1); @@ -899,7 +900,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ error.unwrap_or_default() )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); if backup_target.is_some() { @@ -909,7 +910,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -981,7 +982,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ io.write_error( PhpMixed::String(format!("<info>Removing: {}</info>", file_str)), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); fs.remove(&file_str); } @@ -1077,7 +1078,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ local_filename )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let help_message = "Please run the self-update command as an Administrator."; let question = @@ -1090,7 +1091,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ help_message )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return false; @@ -1103,7 +1104,7 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ io.write_error( PhpMixed::String(format!("<error>Operation failed. {}</error>", help_message)), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return false; @@ -1168,13 +1169,13 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ io.write_error( PhpMixed::String("<info>Operation succeeded.</info>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } else { io.write_error( PhpMixed::String(format!("<error>Operation failed. {}</error>", help_message)), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } diff --git a/crates/shirabe/src/command/update_command.rs b/crates/shirabe/src/command/update_command.rs index aeeb7ba..dca0d07 100644 --- a/crates/shirabe/src/command/update_command.rs +++ b/crates/shirabe/src/command/update_command.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Command/UpdateCommand.php +use crate::io::io_interface; use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::preg::Preg; @@ -119,7 +120,7 @@ impl UpdateCommand { "<warning>You are using the deprecated option \"--dev\". It has no effect and will break in Composer 3.</warning>".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } if input.get_option("no-suggest").as_bool().unwrap_or(false) { @@ -128,7 +129,7 @@ impl UpdateCommand { "<warning>You are using the deprecated option \"--no-suggest\". It has no effect and will break in Composer 3.</warning>".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -140,7 +141,7 @@ impl UpdateCommand { "<warning>Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.</warning>".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); } @@ -228,7 +229,7 @@ impl UpdateCommand { todo!("root_requirements[package].get_pretty_constraint()"), )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); io.write( PhpMixed::String(format!( @@ -236,7 +237,7 @@ impl UpdateCommand { package, package, constraint, )), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(BaseCommand::FAILURE); @@ -339,7 +340,7 @@ impl UpdateCommand { .to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(-1); @@ -449,7 +450,7 @@ impl UpdateCommand { io.write_error( PhpMixed::String("<info>Bumping dependencies</info>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let mut bump_command = BumpCommand::new(); bump_command.set_composer(composer.clone()); @@ -511,7 +512,7 @@ impl UpdateCommand { io.write_error( PhpMixed::String("<info>Loading packages that can be updated...</info>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let mut autocompleter_values: IndexMap<String, String> = IndexMap::new(); let installed_packages = if composer.get_locker().is_locked() { |
