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/platform.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/platform.rs')
| -rw-r--r-- | crates/shirabe/src/util/platform.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/shirabe/src/util/platform.rs b/crates/shirabe/src/util/platform.rs index 7b1c8f61..9ebf4f4f 100644 --- a/crates/shirabe/src/util/platform.rs +++ b/crates/shirabe/src/util/platform.rs @@ -5,7 +5,7 @@ use crate::util::Silencer; use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{ PHP_ENV, PHP_SERVER, PhpMixed, PhpResource, RuntimeException, defined, file_exists, - file_get_contents, fstat, function_exists, getcwd, getenv, in_array, ini_get, is_array, + file_get_contents, fstat, function_exists, getcwd, getenv, in_array_strict, ini_get, is_array, is_readable, mb_strlen, php_os_family, php_regex, posix_geteuid, posix_getpwuid, posix_getuid, posix_isatty, putenv, putenv_clear, realpath, stream_isatty, stripos, strlen, strtoupper, substr, usleep, @@ -280,13 +280,12 @@ impl Platform { // detect msysgit/mingw and assume this is a tty because detection // does not work correctly, see https://github.com/composer/composer/issues/9690 - if in_array( - PhpMixed::String(strtoupper(&Self::get_env("MSYSTEM").unwrap_or_default())), - &PhpMixed::List(vec![ + if in_array_strict( + strtoupper(&Self::get_env("MSYSTEM").unwrap_or_default()), + &[ PhpMixed::String("MINGW32".to_string()), PhpMixed::String("MINGW64".to_string()), - ]), - true, + ], ) { return true; } |
