From 73911c5da18cd37761f90a15558d76d5742f38e5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 05:42:23 +0900 Subject: refactor(php-shim): replace sprintf todo!() with an unsupported panic %e/%E/%g/%G never appear in Composer's own format strings (verified by sweeping composer/src and vendor); supporting PHP's exponent formatting is intentionally out of scope, so fail permanently instead of marking the specifiers as pending work. Co-Authored-By: Claude Fable 5 --- crates/shirabe-php-shim/src/string.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/shirabe-php-shim/src/string.rs b/crates/shirabe-php-shim/src/string.rs index 8a96a8c3..9563d614 100644 --- a/crates/shirabe-php-shim/src/string.rs +++ b/crates/shirabe-php-shim/src/string.rs @@ -876,10 +876,11 @@ pub fn sprintf(_format: &str, _args: &[PhpMixed]) -> String { } (s, false) } - // TODO(phase-d): %e/%E/%g/%G are not ported; their exponent formatting differs from - // Rust's default float formatting and an exact PHP match has not been implemented. - b'e' | b'E' | b'g' | b'G' => todo!("sprintf conversion %{}", spec as char), - _ => todo!("sprintf conversion %{}", spec as char), + // Intentionally unsupported: no Composer format string uses these, and PHP's + // exponent formatting differs from Rust's default float formatting. + _ => { + panic!("Unsupported sprintf() format specifier: %{}", spec as char) + } }; out.push_str(&sprintf_pad(core, width, left, pad, numeric)); -- cgit v1.3.1