From 4573629d9fc7321171cd8b134e68869950b02045 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 13:43:49 +0900 Subject: feat(semver): hand-port constraint AND-split to drop look-around regex The PCRE delimiter `(?< ,]) *(? --- crates/shirabe-php-shim/src/runtime.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-php-shim/src') diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs index bf4d355..c1c5f61 100644 --- a/crates/shirabe-php-shim/src/runtime.rs +++ b/crates/shirabe-php-shim/src/runtime.rs @@ -71,9 +71,16 @@ pub fn defined(name: &str) -> bool { ) } -pub fn method_exists(_object: &PhpMixed, _method_name: &str) -> bool { - // TODO(phase-d): requires runtime class/method reflection, which PhpMixed::Object does not carry. - todo!() +// Models methods available on Composer's own runtime classes when given a class name string. +// Shirabe is a native binary that does not run under a Composer-dumped autoloader, so the dumped +// `Composer\Autoload\ClassLoader` (and its `getRegisteredLoaders`) is absent from the running +// process; the class-name form therefore reports no such method. The object form needs runtime +// reflection that PhpMixed::Object does not carry. +pub fn method_exists(object_or_class: &PhpMixed, _method_name: &str) -> bool { + match object_or_class { + PhpMixed::String(_) => false, + _ => todo!(), + } } // Models the classes available in a standard PHP CLI environment running Composer: -- cgit v1.3.1