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/command/search_command.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/command/search_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/search_command.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/shirabe/src/command/search_command.rs b/crates/shirabe/src/command/search_command.rs index b0eabf80..0b675109 100644 --- a/crates/shirabe/src/command/search_command.rs +++ b/crates/shirabe/src/command/search_command.rs @@ -19,7 +19,7 @@ use shirabe_external_packages::symfony::console::formatter::OutputFormatter; use shirabe_external_packages::symfony::console::input::InputInterface; use shirabe_external_packages::symfony::console::output::OutputInterface; use shirabe_php_shim::{ - InvalidArgumentException, PhpMixed, impl_php_class, implode, in_array, preg_quote, substr, + InvalidArgumentException, PhpMixed, impl_php_class, implode, in_array_loose, preg_quote, substr, }; #[derive(Debug)] @@ -120,13 +120,12 @@ impl Command for SearchCommand { .as_string() .map(|s| s.to_string()) .unwrap_or_else(|| "text".to_string()); - if !in_array( - PhpMixed::String(format.clone()), - &PhpMixed::List(vec![ + if !in_array_loose( + format.clone(), + &[ PhpMixed::String("text".to_string()), PhpMixed::String("json".to_string()), - ]), - false, + ], ) { io.write_error(&format!( "Unsupported format \"{}\". See help for supported formats.", |
