diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-19 21:46:01 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-19 21:46:08 +0900 |
| commit | 5e31fa33c3b5cf726a57a063b8e7a070869250fe (patch) | |
| tree | 98522466966fa7df483cad174ab5fc03db39bc09 /crates/shirabe-php-shim | |
| parent | c839244d8d09f3036ebfee8eef7eb6b147e593ab (diff) | |
| download | php-shirabe-5e31fa33c3b5cf726a57a063b8e7a070869250fe.tar.gz php-shirabe-5e31fa33c3b5cf726a57a063b8e7a070869250fe.tar.zst php-shirabe-5e31fa33c3b5cf726a57a063b8e7a070869250fe.zip | |
fix(compile): fix more random compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 25 |
1 files changed, 25 insertions, 0 deletions
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<String, Box<PhpMixed>>> { + match self { + PhpMixed::Array(a) => Some(a), + _ => None, + } + } + + pub fn as_list_mut(&mut self) -> Option<&mut Vec<Box<PhpMixed>>> { + 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) } |
