From 5c872cd39802739bfe5e21913b968fe0ae934830 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 17:02:16 +0900 Subject: fix(json-loader): pass decoded config to loader instead of empty map The Phase B stub discarded the decoded PhpMixed and handed an empty IndexMap to LoaderInterface::load, so nothing was actually loaded. Unbox PhpMixed::Array into the map; mirror PHP's array $config type juggling by raising a TypeError for non-array decode results. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe-php-shim/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crates/shirabe-php-shim/src/lib.rs') diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index e87cd2d..9b264e2 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -310,6 +310,20 @@ impl std::fmt::Display for InvalidArgumentException { impl std::error::Error for InvalidArgumentException {} +#[derive(Debug)] +pub struct TypeError { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for TypeError { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + todo!() + } +} + +impl std::error::Error for TypeError {} + #[derive(Debug)] pub struct LogicException { pub message: String, -- cgit v1.3.1