aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-06 17:02:16 +0900
committernsfisis <nsfisis@gmail.com>2026-06-06 17:02:16 +0900
commit5c872cd39802739bfe5e21913b968fe0ae934830 (patch)
tree6cc561f58bf3b1fbd7b943c5b2cfca6311ea67ed /crates/shirabe-php-shim
parent44e82cc7d937d49593c6f436d03a38f3371b6873 (diff)
downloadphp-shirabe-5c872cd39802739bfe5e21913b968fe0ae934830.tar.gz
php-shirabe-5c872cd39802739bfe5e21913b968fe0ae934830.tar.zst
php-shirabe-5c872cd39802739bfe5e21913b968fe0ae934830.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim')
-rw-r--r--crates/shirabe-php-shim/src/lib.rs14
1 files changed, 14 insertions, 0 deletions
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
@@ -311,6 +311,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,
pub code: i64,