From a2f8edf2b7ccbb66bb93b811af82d575b9ac31ea Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 9 Aug 2026 09:51:40 +0900 Subject: feat(php-shim): replace error_get_last with the failing call's io::Error The shim raises no PHP-level errors, so error_get_last() always returned None and every message built from it lost its trailing reason. Now that the fs mutators and php_strip_whitespace carry an io::Error, take the reason from the call that actually failed instead of a global last-error slot. Filesystem::unlinkImplementation returns that error rather than a bool so ensureDirectoryExists, unlink and rmdir can report it, and PhpFileParser appends it to the "following message may be helpful" hint. The wording is Rust's io::Error text, not PHP's warning text, for the same reason noted in symfony/filesystem. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/src/runtime.rs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'crates/shirabe-php-shim/src/runtime.rs') diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs index 2f8b79f1..6b165567 100644 --- a/crates/shirabe-php-shim/src/runtime.rs +++ b/crates/shirabe-php-shim/src/runtime.rs @@ -360,11 +360,6 @@ pub fn call_php_callable(_callback: &PhpMixed, _args: &[PhpMixed]) -> PhpMixed { todo!() } -// The shim does not raise PHP-level errors, so there is never a last error. -pub fn error_get_last() -> Option> { - None -} - pub fn ini_set(_varname: &str, _value: &str) -> Option { // TODO(php-runtime): ini_set must return the previous value and have its override observed by a // subsequent ini_get; ini_get is currently a static lookup, so overrides cannot be wired up yet. -- cgit v1.3.1-4-g156e