From 8f36243d2def5a83b3b3e1f0273a307d39951a28 Mon Sep 17 00:00:00 2001 From: Joris Vaesen Date: Mon, 9 Mar 2026 17:24:39 +0100 Subject: [PATCH 1/2] varexporter compatibility + fix phpunit deprecations --- composer.json | 4 ++-- tests/ReflectionToolsTest.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 8d6003c..f6ef03f 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "license": "MIT", "require": { "php": "^8.1", - "brick/varexporter": "^0.3.7 || ^0.4.0 || ^0.5.0" + "brick/varexporter": "^0.3.7 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0" }, "require-dev": { "phpunit/phpunit": "^10.5", @@ -25,4 +25,4 @@ "Brick\\Reflection\\Tests\\": "tests/" } } -} +} \ No newline at end of file diff --git a/tests/ReflectionToolsTest.php b/tests/ReflectionToolsTest.php index 1dcb568..dd47abf 100644 --- a/tests/ReflectionToolsTest.php +++ b/tests/ReflectionToolsTest.php @@ -82,7 +82,7 @@ public function testGetProperties(string $class, array $expected): void self::assertSame($expected, $actual); } - public function hierarchyTestProvider(): array + public static function hierarchyTestProvider(): array { return [ ['A', [ @@ -126,7 +126,7 @@ public function testExportFunctionSignature(ReflectionMethod $method, string $ex self::assertSame($expectedFunctionSignature, $tools->exportFunctionSignature($method)); } - public function providerExportFunction(): Generator + public static function providerExportFunction(): Generator { $classes = [ PHP80::class, @@ -147,7 +147,7 @@ public function providerExportFunction(): Generator $reflectionAttributes, ); - $expectFunctionSignature = $this->matchExpectFunctionSignature($expectFunctionSignatures); + $expectFunctionSignature = self::matchExpectFunctionSignature($expectFunctionSignatures); yield [$reflectionMethod, $expectFunctionSignature->functionSignature]; } @@ -157,10 +157,10 @@ public function providerExportFunction(): Generator /** * @param ExpectFunctionSignature[] $expectFunctionSignatures */ - private function matchExpectFunctionSignature(array $expectFunctionSignatures): ExpectFunctionSignature + private static function matchExpectFunctionSignature(array $expectFunctionSignatures): ExpectFunctionSignature { foreach ($expectFunctionSignatures as $expectFunctionSignature) { - if ($this->phpMatchesVersionConstraint($expectFunctionSignature->phpVersionConstraint)) { + if (self::phpMatchesVersionConstraint($expectFunctionSignature->phpVersionConstraint)) { return $expectFunctionSignature; } } @@ -168,7 +168,7 @@ private function matchExpectFunctionSignature(array $expectFunctionSignatures): throw new Exception('No ExpectFunctionSignature attribute found matching current PHP version'); } - private function phpMatchesVersionConstraint(?string $versionConstraint): bool + private static function phpMatchesVersionConstraint(?string $versionConstraint): bool { if ($versionConstraint === null) { return true; @@ -200,4 +200,4 @@ private function phpMatchesVersionConstraint(?string $versionConstraint): bool return in_array($comparisonValue, $allowedComparisonValues, true); } -} +} \ No newline at end of file From ac118a3b3be71d77fc5069e181d9f09cd2703308 Mon Sep 17 00:00:00 2001 From: Joris Vaesen Date: Mon, 9 Mar 2026 17:34:38 +0100 Subject: [PATCH 2/2] formatting fix --- tests/ReflectionToolsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ReflectionToolsTest.php b/tests/ReflectionToolsTest.php index dd47abf..ff05591 100644 --- a/tests/ReflectionToolsTest.php +++ b/tests/ReflectionToolsTest.php @@ -200,4 +200,4 @@ private static function phpMatchesVersionConstraint(?string $versionConstraint): return in_array($comparisonValue, $allowedComparisonValues, true); } -} \ No newline at end of file +}