From 5e31fa33c3b5cf726a57a063b8e7a070869250fe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 19 May 2026 21:46:01 +0900 Subject: fix(compile): fix more random compile errors Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/shirabe-php-shim/src/lib.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 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 e6fbf05..6b2d790 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -55,6 +55,31 @@ impl PhpMixed { } } + pub fn as_array_mut(&mut self) -> Option<&mut IndexMap>> { + match self { + PhpMixed::Array(a) => Some(a), + _ => None, + } + } + + pub fn as_list_mut(&mut self) -> Option<&mut Vec>> { + match self { + PhpMixed::List(l) => Some(l), + _ => None, + } + } + + pub fn as_object(&self) -> Option<&ArrayObject> { + match self { + PhpMixed::Object(o) => Some(o), + _ => None, + } + } + + pub fn as_str(&self) -> Option<&str> { + self.as_string() + } + pub fn is_null(&self) -> bool { matches!(self, PhpMixed::Null) } -- cgit v1.3.1