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/util/process_executor.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/util/process_executor.rs')
| -rw-r--r-- | crates/shirabe/src/util/process_executor.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs index c24e2f83..463c5d19 100644 --- a/crates/shirabe/src/util/process_executor.rs +++ b/crates/shirabe/src/util/process_executor.rs @@ -15,8 +15,9 @@ use shirabe_external_packages::symfony::process::exception::ProcessSignaledExcep use shirabe_external_packages::symfony::process::exception::RuntimeException as SymfonyProcessRuntimeException; use shirabe_php_shim::{ LogicException, PHP_EOL, PhpMixed, RuntimeException, array_intersect, array_map, - escapeshellarg, explode, implode, in_array, is_array, is_dir, is_numeric, is_string, php_regex, - rtrim, str_replace, strcspn, strlen, strpbrk, strtolower, strtr_array, substr_replace, trim, + escapeshellarg, explode, implode, in_array_strict, is_array, is_dir, is_numeric, is_string, + php_regex, rtrim, str_replace, strcspn, strlen, strpbrk, strtolower, strtr_array, + substr_replace, trim, }; use std::sync::{LazyLock, Mutex}; @@ -974,15 +975,12 @@ impl ProcessExecutor { /// Resolves executable paths on Windows fn get_executable(name: &str) -> String { - if in_array( - PhpMixed::String(strtolower(name)), - &PhpMixed::List( - Self::BUILTIN_CMD_COMMANDS - .iter() - .map(|s| PhpMixed::String(s.to_string())) - .collect(), - ), - true, + if in_array_strict( + strtolower(name), + &Self::BUILTIN_CMD_COMMANDS + .iter() + .map(|s| PhpMixed::String(s.to_string())) + .collect::<Vec<_>>(), ) { return name.to_string(); } |
