From 7439cdb08afe0882186a34f70c1e8878fcb7dca5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 8 Jun 2026 04:30:56 +0900 Subject: feat(phase-c): resolve static-property phase-b TODOs Implement the FileDownloader::$downloadMetadata accessors over the existing DOWNLOAD_METADATA static, and drop now-stale TODOs on the already-correct Platform::strlen function-local static and the ClassLoader include-closure no-op. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/autoload/class_loader.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/autoload') diff --git a/crates/shirabe/src/autoload/class_loader.rs b/crates/shirabe/src/autoload/class_loader.rs index 745e9f2..083e1c3 100644 --- a/crates/shirabe/src/autoload/class_loader.rs +++ b/crates/shirabe/src/autoload/class_loader.rs @@ -17,7 +17,9 @@ static REGISTERED_LOADERS: LazyLock>> = /// ClassLoader implements a PSR-0, PSR-4 and classmap class loader. #[derive(Debug, Clone)] pub struct ClassLoader { - // PHP: private static $includeFile — TODO(phase-b): stash include closure as a static + // PHP holds a `private static $includeFile` closure purely to run `include $file` in an + // isolated scope. The `include_file` shim is a free function with no `self`/`Self` access, so + // that scope isolation is inherent and there is no static state to keep on the Rust side. /// @var string|null vendor_dir: Option, @@ -491,8 +493,9 @@ impl ClassLoader { } fn initialize_include_closure() { - // TODO(phase-b): preserve PHP `\Closure::bind(static fn($file) => include $file, null, null)` - // Rust has no `include` operator; this is a no-op placeholder. + // PHP lazily binds `self::$includeFile` to a scope-isolated `include $file` closure. The + // Rust `include_file` shim already provides that isolation as a free function, so there is + // no closure to bind and this is intentionally a no-op. } /// PHP `(array) $loader`. Every property is private, so keys are mangled as -- cgit v1.3.1