From 6a6ec1b8f8a5c70d21f3772ce637b763e8ab21ea Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 31 Aug 2026 00:15:52 +0900 Subject: feat(plugin): carry Http\Response across as a materialized value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A response is built for one request and the graph never retains it, so there is no entity for a handle to point at. The child holds a real instance instead, revived from the object record the wire carries, and collect() frees the copy each world holds — which is what that method is for. The value-object rule rejects the class only because collect() assigns to $this, so the category comes from an overrides.list entry. HttpDownloader::get() and copy() answer with one. Two gaps stay: decodeJson() reaches Composer\Json\JsonFile, which a guard shadows, and Composer answers a curl request with the CurlResponse subclass where this port flattens the value into a Response. Co-Authored-By: Claude Opus 5 (1M context) --- .../php/guards/Composer/Util/Http/CurlResponse.php | 40 +++++++++++++++ .../php/guards/Composer/Util/Http/Response.php | 57 ---------------------- .../php/runtime/Shirabe/MaterializedValue.php | 2 + 3 files changed, 42 insertions(+), 57 deletions(-) delete mode 100644 crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php (limited to 'crates/shirabe-php-rpc/php') diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php index ae229589..ffb000f3 100644 --- a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php @@ -19,4 +19,44 @@ class CurlResponse extends Response { \ShirabeUnsupportedClass::fail(self::class, 'getCurlInfo'); } + + public function getStatusCode(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getStatusCode'); + } + + public function getStatusMessage(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getStatusMessage'); + } + + public function getHeaders(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getHeaders'); + } + + public function getHeader(string $name): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getHeader'); + } + + public function getBody(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getBody'); + } + + public function decodeJson() + { + \ShirabeUnsupportedClass::fail(self::class, 'decodeJson'); + } + + public function collect(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'collect'); + } + + public static function findHeaderValue(array $headers, string $name): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'findHeaderValue'); + } } diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php deleted file mode 100644 index 61eebb7f..00000000 --- a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php +++ /dev/null @@ -1,57 +0,0 @@ -