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/filesystem_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/filesystem_repository.rs')
| -rw-r--r-- | crates/shirabe/src/repository/filesystem_repository.rs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/crates/shirabe/src/repository/filesystem_repository.rs b/crates/shirabe/src/repository/filesystem_repository.rs index 7ecd0664..47241bde 100644 --- a/crates/shirabe/src/repository/filesystem_repository.rs +++ b/crates/shirabe/src/repository/filesystem_repository.rs @@ -20,8 +20,8 @@ use crate::util::Platform; use indexmap::IndexMap; use shirabe_php_shim::{ Exception, InvalidArgumentException, LogicException, PhpMixed, UnexpectedValueException, - array_flip, dirname, get_class_err, get_debug_type, in_array, is_array, is_null, is_string, - ksort, realpath, str_repeat, usort, var_export, + array_flip, dirname, get_class_err, get_debug_type, in_array_strict, is_array, is_null, + is_string, ksort, realpath, str_repeat, usort, var_export, }; use shirabe_semver::constraint::AnyConstraint; @@ -281,17 +281,15 @@ impl FilesystemRepository { // only write to the files the names which are really installed, as we receive the full list // of dev package names before they get installed during composer install - if in_array( - PhpMixed::String(package.get_name().to_string()), - &PhpMixed::List( - self.inner - .dev_package_names - .borrow() - .iter() - .map(|s| PhpMixed::String(s.clone())) - .collect(), - ), - true, + if in_array_strict( + package.get_name().to_string(), + &self + .inner + .dev_package_names + .borrow() + .iter() + .map(|s| PhpMixed::String(s.clone())) + .collect::<Vec<_>>(), ) && let Some(PhpMixed::List(list)) = data.get_mut("dev-package-names") { list.push(PhpMixed::String(package.get_name().to_string())); |
