diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-06 06:25:10 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-06 06:25:30 +0900 |
| commit | 791ef1cd465597ff43dab4216c4b00e9e4160da8 (patch) | |
| tree | ec6c3bc45f81576146325350faa6dcea638987b4 /crates/shirabe/src/repository/composer_repository.rs | |
| parent | a86bbd67954f7bbc38bb09138edb335d82666526 (diff) | |
| download | php-shirabe-791ef1cd465597ff43dab4216c4b00e9e4160da8.tar.gz php-shirabe-791ef1cd465597ff43dab4216c4b00e9e4160da8.tar.zst php-shirabe-791ef1cd465597ff43dab4216c4b00e9e4160da8.zip | |
refactor(php-shim): split in_array into strict and loose variants
Diffstat (limited to 'crates/shirabe/src/repository/composer_repository.rs')
| -rw-r--r-- | crates/shirabe/src/repository/composer_repository.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs index c83ffcd9..833be0af 100644 --- a/crates/shirabe/src/repository/composer_repository.rs +++ b/crates/shirabe/src/repository/composer_repository.rs @@ -40,8 +40,8 @@ use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_metadata_minifier::MetadataMinifier; use shirabe_php_shim::{ InvalidArgumentException, LogicException, PHP_EOL, PhpMixed, RuntimeException, - UnexpectedValueException, extension_loaded, hash, http_build_query, in_array, json_decode, - parse_url_all, php_regex, realpath, strtolower, strtr, urlencode, var_export, + UnexpectedValueException, extension_loaded, hash, http_build_query, in_array_strict, + json_decode, parse_url_all, php_regex, realpath, strtolower, strtr, urlencode, var_export, }; use shirabe_semver::CompilingMatcher; use shirabe_semver::constraint::AnyConstraint; @@ -1441,13 +1441,12 @@ impl ComposerRepository { if let Some(te) = e.downcast_ref::<TransportException>() { let status_code = te.get_status_code(); if self.lazy_providers_url.is_some() - && in_array( + && in_array_strict( match status_code { Some(c) => PhpMixed::Int(c), None => PhpMixed::Null, }, - &PhpMixed::List(vec![PhpMixed::Int(404), PhpMixed::Int(499)]), - true, + &[PhpMixed::Int(404), PhpMixed::Int(499)], ) { let mut p: IndexMap<String, PhpMixed> = IndexMap::new(); |
