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/util/github.rs | |
| 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/util/github.rs')
| -rw-r--r-- | crates/shirabe/src/util/github.rs | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/crates/shirabe/src/util/github.rs b/crates/shirabe/src/util/github.rs index 9911084..c04873f 100644 --- a/crates/shirabe/src/util/github.rs +++ b/crates/shirabe/src/util/github.rs @@ -1,5 +1,6 @@ //! ref: composer/src/Composer/Util/GitHub.php +use crate::io::io_interface; use shirabe_external_packages::composer::pcre::preg::Preg; use shirabe_php_shim::{PhpMixed, date, stripos, strtolower}; @@ -80,8 +81,11 @@ impl GitHub { message: Option<&str>, ) -> anyhow::Result<bool> { if let Some(msg) = message { - self.io - .write_error(PhpMixed::String(msg.to_string()), true, IOInterface::NORMAL); + self.io.write_error( + PhpMixed::String(msg.to_string()), + true, + io_interface::NORMAL, + ); } let mut note = "Composer".to_string(); @@ -127,7 +131,7 @@ impl GitHub { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let encoded_note = shirabe_php_shim::rawurlencode(¬e).replace("%20", "+"); @@ -149,7 +153,7 @@ impl GitHub { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io.write_error( @@ -170,7 +174,7 @@ impl GitHub { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io.write_error( @@ -194,7 +198,7 @@ impl GitHub { Box::new(PhpMixed::String(String::new())), ]), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io.write_error( @@ -202,7 +206,7 @@ impl GitHub { "For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let mut store_in_local_auth_config = false; @@ -225,14 +229,14 @@ impl GitHub { self.io.write_error( PhpMixed::String("<warning>No token given, aborting.</warning>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io.write_error( PhpMixed::String( "You can also add it manually later by using \"composer config --global --auth github-oauth.github.com <token>\"".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(false); } @@ -266,14 +270,14 @@ impl GitHub { self.io.write_error( PhpMixed::String("<error>Invalid token provided.</error>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io.write_error( PhpMixed::String( "You can also add it manually later by using \"composer config --global --auth github-oauth.github.com <token>\"".to_string(), ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); return Ok(false); } @@ -307,7 +311,7 @@ impl GitHub { self.io.write_error( PhpMixed::String("<info>Token stored successfully.</info>".to_string()), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); Ok(true) |
