From fb8b9c2f3b68d6a80fc30cf4a74bd54535004b59 Mon Sep 17 00:00:00 2001 From: Renan Rodrigo Date: Thu, 26 Feb 2026 12:19:52 -0300 Subject: [PATCH 1/2] Implement missing stream wrapper functions PHP 8.5 seems to not ignore or tolerate missing methods in classes implementing the StreamWrapper interface. This patch adds the missing methods to the test stream wrapper used in ClassMapGeneratorTest.php, ensuring compatibility with PHP 8.5 and later versions. Fixes: #30 --- tests/ClassMapGeneratorTest.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/ClassMapGeneratorTest.php b/tests/ClassMapGeneratorTest.php index 16a8fc2..032f51d 100644 --- a/tests/ClassMapGeneratorTest.php +++ b/tests/ClassMapGeneratorTest.php @@ -208,6 +208,32 @@ public function stream_read($count) { public function stream_stat() { return $this->resource === false ? false : fstat($this->resource); } + + /** + * @return bool + */ + public function stream_eof() { + return $this->resource === false ? true : feof($this->resource); + } + + /** + * @return void + */ + public function stream_close() { + if ($this->resource !== false) { + fclose($this->resource); + } + } + + /** + * @return array|false + */ + public function url_stat($path, $flags) { + $scheme = parse_url($path, PHP_URL_SCHEME); + $varname = str_replace($scheme . '://', '', $path); + + return stat(self::$rootPath . '/' . $varname); + } }; $testProxyStreamWrapper::$rootPath = realpath(__DIR__) . '/Fixtures/classmap'; From 139777ccc5ce29a6c0db0c03ada3896089bd90cf Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 2 Mar 2026 10:32:11 +0100 Subject: [PATCH 2/2] Add type hints to url_stat method parameters --- tests/ClassMapGeneratorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ClassMapGeneratorTest.php b/tests/ClassMapGeneratorTest.php index 032f51d..2723c71 100644 --- a/tests/ClassMapGeneratorTest.php +++ b/tests/ClassMapGeneratorTest.php @@ -228,7 +228,7 @@ public function stream_close() { /** * @return array|false */ - public function url_stat($path, $flags) { + public function url_stat(string $path, int $flags) { $scheme = parse_url($path, PHP_URL_SCHEME); $varname = str_replace($scheme . '://', '', $path);