aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/process
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-06 10:37:12 +0900
committernsfisis <nsfisis@gmail.com>2026-08-06 10:37:12 +0900
commitd9dca94603766712b5989ea8169c9e286d27a60c (patch)
treeb8c75845bf2d93771c91c7d7058a0ed041f94edc /crates/shirabe-external-packages/src/symfony/process
parent70e463708b461efd61a611061cfee0539d28645a (diff)
downloadphp-shirabe-d9dca94603766712b5989ea8169c9e286d27a60c.tar.gz
php-shirabe-d9dca94603766712b5989ea8169c9e286d27a60c.tar.zst
php-shirabe-d9dca94603766712b5989ea8169c9e286d27a60c.zip
refactor(php-shim): take &str and return String from pathinfo
pathinfo only ever receives a string and only ever returns one for the single-component options it supports, so the PhpMixed wrapping forced every call site to pack and unpack the value again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/process')
-rw-r--r--crates/shirabe-external-packages/src/symfony/process/executable_finder.rs26
1 files changed, 9 insertions, 17 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs
index d4891af0..3c44b4ad 100644
--- a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs
+++ b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs
@@ -1,7 +1,5 @@
//! ref: composer/vendor/symfony/process/ExecutableFinder.php
-use shirabe_php_shim::PhpMixed;
-
const CMD_BUILTINS: &[&str] = &[
"assoc", "break", "call", "cd", "chdir", "cls", "color", "copy", "date", "del", "dir", "echo",
"endlocal", "erase", "exit", "for", "ftype", "goto", "help", "if", "label", "md", "mkdir",
@@ -58,21 +56,15 @@ impl ExecutableFinder {
};
suffixes.extend(exts);
}
- suffixes = if !shirabe_php_shim::pathinfo(
- PhpMixed::String(name.to_string()),
- shirabe_php_shim::PATHINFO_EXTENSION,
- )
- .as_string()
- .unwrap_or("")
- .is_empty()
- {
- let mut s = vec![String::new()];
- s.extend(suffixes);
- s
- } else {
- suffixes.push(String::new());
- suffixes
- };
+ suffixes =
+ if !shirabe_php_shim::pathinfo(name, shirabe_php_shim::PATHINFO_EXTENSION).is_empty() {
+ let mut s = vec![String::new()];
+ s.extend(suffixes);
+ s
+ } else {
+ suffixes.push(String::new());
+ suffixes
+ };
for suffix in &suffixes {
for dir in &dirs {
let dir = if dir.is_empty() { "." } else { dir.as_str() };