From 3a0d9340810a8808d963135a884f50d08442ac67 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 16:27:53 +0900 Subject: test: port 59 autoload/vcs/installer/util/command tests; fix output capture Port autoload_generator (24), bitbucket (14), suggested_packages (11), git_driver (6), archive_manager (3), and a bump command test. Fix the ApplicationTester output-capture root cause (php://memory streams must be readable regardless of fopen mode). Implement posix_getuid/geteuid, the PCRE 'A' anchored modifier, php_strip_whitespace, stream_get_wrappers, is_callable scalars; fix preg_quote angle-bracket escaping and class-map parser regexes. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-php-shim/src/var.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'crates/shirabe-php-shim/src/var.rs') diff --git a/crates/shirabe-php-shim/src/var.rs b/crates/shirabe-php-shim/src/var.rs index adaacec..3fba9d6 100644 --- a/crates/shirabe-php-shim/src/var.rs +++ b/crates/shirabe-php-shim/src/var.rs @@ -120,11 +120,15 @@ pub fn is_numeric(value: &PhpMixed) -> bool { } } -pub fn is_callable(_value: &PhpMixed) -> bool { - // TODO(phase-d): PHP is_callable() checks whether the value names an existing function/method or - // is a closure. PhpMixed has no callable variant and the shim has no function registry, so - // callability cannot be determined. - todo!() +pub fn is_callable(value: &PhpMixed) -> bool { + match value { + // Scalars and null are never callable in PHP. + PhpMixed::Null | PhpMixed::Bool(_) | PhpMixed::Int(_) | PhpMixed::Float(_) => false, + // TODO(phase-d): PHP is_callable() checks whether a string names an existing function, or an + // array/object resolves to a method/__invoke. PhpMixed has no callable variant and the shim + // has no function/method registry, so callability of these cannot be determined. + _ => todo!(), + } } pub fn is_object(_value: &PhpMixed) -> bool { -- cgit v1.3.1