diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-06 10:37:12 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-06 10:37:12 +0900 |
| commit | d9dca94603766712b5989ea8169c9e286d27a60c (patch) | |
| tree | b8c75845bf2d93771c91c7d7058a0ed041f94edc /crates/shirabe/src/factory.rs | |
| parent | 70e463708b461efd61a611061cfee0539d28645a (diff) | |
| download | php-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/src/factory.rs')
| -rw-r--r-- | crates/shirabe/src/factory.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/shirabe/src/factory.rs b/crates/shirabe/src/factory.rs index de632143..7328bf42 100644 --- a/crates/shirabe/src/factory.rs +++ b/crates/shirabe/src/factory.rs @@ -375,15 +375,8 @@ impl Factory { } pub fn get_lock_file(composer_file: &str) -> String { - let ext = pathinfo( - PhpMixed::String(composer_file.to_string()), - PATHINFO_EXTENSION, - ); - let is_json = match ext { - PhpMixed::String(s) => s == "json", - _ => false, - }; - if is_json { + let ext = pathinfo(composer_file, PATHINFO_EXTENSION); + if ext == "json" { format!( "{}lock", substr(composer_file, 0, Some(composer_file.len() as i64 - 4)) |
