From 5ab2c5932d1fba4a35a3063d9472cd69d0936956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Wed, 1 Oct 2025 10:58:31 +0200 Subject: [PATCH 01/27] mod: bump SS framework & CMS to v6 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8c2f727..376e142 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ ], "require": { "php": "~8.0", - "silverstripe/framework": "~5.0", + "silverstripe/framework": "~6.0", "phpstan/phpstan": "^1.5", "silverstripe/versioned": "^2.0" }, @@ -31,7 +31,7 @@ "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^9.4", - "silverstripe/cms": "^5.0" + "silverstripe/cms": "^6.0" }, "scripts": { "phpcs": "phpcs -n -l src/ src/Reflection/ src/Rule/ src/Type tests/ tests/Reflection/ tests/Rule/ tests/Type/", From 846c0d64dab50b0bf02d5328427f86e232202d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Wed, 1 Oct 2025 10:58:59 +0200 Subject: [PATCH 02/27] mod: bump versioned to v3, as SS 6 depends on it --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 376e142..66450df 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "php": "~8.0", "silverstripe/framework": "~6.0", "phpstan/phpstan": "^1.5", - "silverstripe/versioned": "^2.0" + "silverstripe/versioned": "^3.0" }, "require-dev": { "squizlabs/php_codesniffer": "^3.0", From 76b47763512b8be9348cf543a8de7f85ededd090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Wed, 1 Oct 2025 11:05:08 +0200 Subject: [PATCH 03/27] mod: bump phpunit so it and SS agree on a sebastian/diff version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 66450df..8357a44 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^9.4", + "phpunit/phpunit": "^11", "silverstripe/cms": "^6.0" }, "scripts": { From 944b6622bc9eec68a46d6e6d0e1e4abe69e86ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Thu, 2 Oct 2025 13:53:37 +0200 Subject: [PATCH 04/27] mod: fix PHP version to 8.4 versions --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8357a44..2691c28 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "~8.0", + "php": "~8.4.0", "silverstripe/framework": "~6.0", "phpstan/phpstan": "^1.5", "silverstripe/versioned": "^3.0" From c9821e20467bd44af7b5ad9480c6ee74398602e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Thu, 2 Oct 2025 13:59:00 +0200 Subject: [PATCH 05/27] fix: do not do major phpunit updates! --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2691c28..7ae0a1d 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^11", + "phpunit/phpunit": "^11.0", "silverstripe/cms": "^6.0" }, "scripts": { From b6168ccf40d24a91499749f53ff1d699152819af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 13:07:30 +0200 Subject: [PATCH 06/27] mod: loosen PHP requirement --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7ae0a1d..63b33d0 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "~8.4.0", + "php": "~8.1.0", "silverstripe/framework": "~6.0", "phpstan/phpstan": "^1.5", "silverstripe/versioned": "^3.0" From 6cc22fc0442d70c877fc32ceba956c2734223af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 13:51:58 +0200 Subject: [PATCH 07/27] mod: new jobs for workflow --- .github/workflows/tests.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f28917a..7a627b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,25 +28,20 @@ on: - '5' jobs: - silverstripe-module: - name: ๐Ÿงฐ Silverstripe Module Testsuite - uses: syntro-opensource/workflows/.github/workflows/silverstripe-module.yml@5 + silverstripe-module-6: + name: ๐Ÿงฐ Silverstripe Module Testsuite 6 + uses: syntro-opensource/workflows/.github/workflows/silverstripe-module-6.yml@master with: phpunit: true - phpunit_config_file: tests/phpunit.xml phpstan: true - phpstan_config: tests/phpstan.neon - phpstan_bootstrap: tests/bootstrap-phpstan.php - phpcs: true - # silverstripe-client: - # name: ๐Ÿ“ฆ Client Testsuite - # uses: syntro-opensource/workflows/.github/workflows/client.yml@master - # with: - # eslint: true - # eslint_dir: client/src/seo-field/ - # eslint_configfile: client/src/seo-field/.eslintrc - # eslint_ext: - # eslint_max-warnings: - # stylelint: true - # stylelint_glob: client/src/seo-field/**/*.scss - # stylelint_max-warnings: + silverstripe-module-codecoverage: + name: ๐Ÿ“Š Silverstripe Code Coverage + uses: syntro-opensource/workflows/.github/workflows/silverstripe-codecoverage.yml@master + with: + php_version: 8.3 + silverstripe_version: 6.0 + silverstripe-phpcs: + name: ๐Ÿงน Silverstripe PHPCS + uses: syntro-opensource/workflows/.github/workflows/silverstripe-phpcs.yml@master + with: + dir: src/ From 40b50895f2bb4e6578e3224314cacbd0b9f3c85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 13:52:57 +0200 Subject: [PATCH 08/27] mod: apply jobs to 6 branch --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7a627b8..fff2973 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,7 @@ on: branches: - master - '5' + - '6' pull_request: paths-ignore: - .chglog/** From c2d883e0c95fe56b0225a022c1dc4b748cb15a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 13:54:24 +0200 Subject: [PATCH 09/27] fix: path typo --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fff2973..6aa5ff3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,7 +37,7 @@ jobs: phpstan: true silverstripe-module-codecoverage: name: ๐Ÿ“Š Silverstripe Code Coverage - uses: syntro-opensource/workflows/.github/workflows/silverstripe-codecoverage.yml@master + uses: syntro-opensource/workflows/.github/workflows/silverstripe-module-codecoverage.yml@master with: php_version: 8.3 silverstripe_version: 6.0 From 66b2cf3c384c910755d1cc0151a534b44cb89960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 13:58:39 +0200 Subject: [PATCH 10/27] mod: apply jobs to 6 branch --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6aa5ff3..65a48ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,6 +27,7 @@ on: branches: - master - '5' + - '6' jobs: silverstripe-module-6: From 7cf3dd9733d8e42bfa102917d106925538052a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 14:12:14 +0200 Subject: [PATCH 11/27] fix: tighten PHP version (min. 8.3) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 63b33d0..3a1906c 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "~8.1.0", + "php": "~8.3", "silverstripe/framework": "~6.0", "phpstan/phpstan": "^1.5", "silverstripe/versioned": "^3.0" From 70369d836a30c41b61839a72b54e85b6ea8407b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 14:16:05 +0200 Subject: [PATCH 12/27] add: additional PHPstan & code coverage config --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65a48ea..0f7fca2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,13 +35,17 @@ jobs: uses: syntro-opensource/workflows/.github/workflows/silverstripe-module-6.yml@master with: phpunit: true + phpunit_config_file: tests/phpunit.xml phpstan: true + phpstan_config: tests/phpstan.neon + phpstan_bootstrap: tests/bootstrap-phpstan.php silverstripe-module-codecoverage: name: ๐Ÿ“Š Silverstripe Code Coverage uses: syntro-opensource/workflows/.github/workflows/silverstripe-module-codecoverage.yml@master with: php_version: 8.3 silverstripe_version: 6.0 + phpunit_config_file: tests/phpunit.xml silverstripe-phpcs: name: ๐Ÿงน Silverstripe PHPCS uses: syntro-opensource/workflows/.github/workflows/silverstripe-phpcs.yml@master From 4352540c8a11107db923e4e384dc67b5a0e31743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 15:46:31 +0200 Subject: [PATCH 13/27] mod: test newer PHPunit version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3a1906c..f9090b7 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^11.0", + "phpunit/phpunit": "^12.0", "silverstripe/cms": "^6.0" }, "scripts": { From 26a4128d441cb52c641afdadb623aaf07f9b9b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 15:51:16 +0200 Subject: [PATCH 14/27] mod: revert version test --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f9090b7..3a1906c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^12.0", + "phpunit/phpunit": "^11.0", "silverstripe/cms": "^6.0" }, "scripts": { From 71db83db1b4da9bec94274986ef5bce99f01b9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 15:58:05 +0200 Subject: [PATCH 15/27] fix: reflect SS6 class name change --- src/ClassHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ClassHelper.php b/src/ClassHelper.php index beafad9..3349b58 100644 --- a/src/ClassHelper.php +++ b/src/ClassHelper.php @@ -11,7 +11,7 @@ class ClassHelper { // const SSObject = 'Object'; // Removed in SS 4.X - const ViewableData = \SilverStripe\View\ViewableData::class; + const ModelData = \SilverStripe\Model\ModelData::class; const DataObject = \SilverStripe\ORM\DataObject::class; const Extensible = \SilverStripe\Core\Extensible::class; From b7d06c28141a854b3630f926a4547c4895e1adc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 16:31:03 +0200 Subject: [PATCH 16/27] test: test new PHPstan major version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3a1906c..063dca4 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require": { "php": "~8.3", "silverstripe/framework": "~6.0", - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^2.0", "silverstripe/versioned": "^3.0" }, "require-dev": { From 535f9a39252d9acc39358628c80dd5c4d86cdd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 16:33:30 +0200 Subject: [PATCH 17/27] test: revert testing --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 063dca4..3a1906c 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require": { "php": "~8.3", "silverstripe/framework": "~6.0", - "phpstan/phpstan": "^2.0", + "phpstan/phpstan": "^1.5", "silverstripe/versioned": "^3.0" }, "require-dev": { From 4c026edf1bdc22407d5c9fda78876fc9b4979e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 16:34:09 +0200 Subject: [PATCH 18/27] test: ultimate constraint loosening --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3a1906c..fb6826b 100644 --- a/composer.json +++ b/composer.json @@ -24,13 +24,13 @@ "require": { "php": "~8.3", "silverstripe/framework": "~6.0", - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "*", "silverstripe/versioned": "^3.0" }, "require-dev": { "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^11.0", + "phpunit/phpunit": "*", "silverstripe/cms": "^6.0" }, "scripts": { From b50f5e53c764d5b6fc4a6bb1e1f693b5b16f56b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 16:35:18 +0200 Subject: [PATCH 19/27] test: another constraint loosening --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index fb6826b..2fa843d 100644 --- a/composer.json +++ b/composer.json @@ -24,13 +24,13 @@ "require": { "php": "~8.3", "silverstripe/framework": "~6.0", - "phpstan/phpstan": "*", + "phpstan/phpstan": "^2.5", "silverstripe/versioned": "^3.0" }, "require-dev": { "squizlabs/php_codesniffer": "^3.0", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "*", + "phpstan/phpstan-phpunit": "*", + "phpunit/phpunit": "^11.0", "silverstripe/cms": "^6.0" }, "scripts": { From 88847067392ac192111060350d18b7fb447a05ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 16:37:02 +0200 Subject: [PATCH 20/27] fix: wrong phpstan dep --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2fa843d..a672f18 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require": { "php": "~8.3", "silverstripe/framework": "~6.0", - "phpstan/phpstan": "^2.5", + "phpstan/phpstan": "^2.0", "silverstripe/versioned": "^3.0" }, "require-dev": { From 5fdbac8fee03bee4ab2bcba160c78787cd3321e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Mon, 6 Oct 2025 16:46:20 +0200 Subject: [PATCH 21/27] fix: remove testing for 5 and master branch --- .github/workflows/tests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f7fca2..b4e446e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,8 +11,6 @@ on: - .htaccess - '**.md' branches: - - master - - '5' - '6' pull_request: paths-ignore: @@ -25,8 +23,6 @@ on: - .htaccess - '**.md' branches: - - master - - '5' - '6' jobs: From 480e8a99c65b79a2ea027dc36d93d13229940dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Tue, 7 Oct 2025 15:20:27 +0200 Subject: [PATCH 22/27] fix: typo --- tests/Reflection/MethodClassReflectionExtensionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Reflection/MethodClassReflectionExtensionTest.php b/tests/Reflection/MethodClassReflectionExtensionTest.php index 8fd7c97..d773104 100644 --- a/tests/Reflection/MethodClassReflectionExtensionTest.php +++ b/tests/Reflection/MethodClassReflectionExtensionTest.php @@ -6,7 +6,7 @@ use PHPStan\Testing\TypeInferenceTestCase; use SilverStripe\Core\Config\Config; -class MethodClassReflectionExtensionTest extends TypeInferenceTestCase +class MethodClassReflectionExtensionTest extends TypeInferenceTestCase { /** * @return iterable From 0ef09aa4da081f1eabd1182a0a7695cc5a6fd4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Tue, 7 Oct 2025 15:21:42 +0200 Subject: [PATCH 23/27] fix: statify testFileAsserts --- tests/Reflection/MethodClassReflectionExtensionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Reflection/MethodClassReflectionExtensionTest.php b/tests/Reflection/MethodClassReflectionExtensionTest.php index d773104..fb94ab9 100644 --- a/tests/Reflection/MethodClassReflectionExtensionTest.php +++ b/tests/Reflection/MethodClassReflectionExtensionTest.php @@ -21,12 +21,12 @@ public function dataFileAsserts(): iterable /** * @dataProvider dataFileAsserts */ - public function testFileAsserts( + public static function testFileAsserts( string $assertType, string $file, ...$args ): void { - $this->assertFileAsserts($assertType, $file, ...$args); + singleton(self::class)->assertFileAsserts($assertType, $file, ...$args); } public static function getAdditionalConfigFiles(): array From cb9b3e46e83a2c721d86d834a423c4b76b2a1b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Tue, 7 Oct 2025 16:32:18 +0200 Subject: [PATCH 24/27] mod: shotgun static! --- .../SiteTreeMethodClassReflectionExtensionTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php b/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php index 2694c01..db28e58 100644 --- a/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php +++ b/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php @@ -15,19 +15,19 @@ final class SiteTreeMethodClassReflectionExtensionTest extends \PHPStan\Testing\PHPStanTestCase { /** @var \PHPStan\Broker\Broker */ - private $broker; + private static $broker; /** @var MethodClassReflectionExtension */ - private $method; + private static $method; protected function setUp(): void { - $this->broker = $this->createBroker(); - $this->method = new MethodClassReflectionExtension(); - $this->method->setBroker($this->broker); + self::$broker = $this->createReflectionProvider(); + self::$method = new MethodClassReflectionExtension(); + self::$method->setBroker($this->broker); } - public function dataHasMethod(): array + public static function dataHasMethod(): array { return [ [ From edf0c0727a48ce25193a415e563c9e8f3bdd886e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Tue, 7 Oct 2025 16:33:25 +0200 Subject: [PATCH 25/27] mod: shotgun static! --- .../SiteTreeMethodClassReflectionExtensionTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php b/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php index db28e58..817b435 100644 --- a/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php +++ b/tests/Reflection/SiteTreeMethodClassReflectionExtensionTest.php @@ -54,10 +54,10 @@ public static function dataHasMethod(): array * @param string $method * @param bool $result */ - public function testHasMethod(string $className, string $method, bool $result): void + public static function testHasMethod(string $className, string $method, bool $result): void { - $classReflection = $this->broker->getClass($className); - self::assertSame($result, $this->method->hasMethod($classReflection, $method)); + $classReflection = self::$broker->getClass($className); + self::assertSame($result, self::$method->hasMethod($classReflection, $method)); } public function testParentMethod(): void @@ -74,10 +74,10 @@ public function testParentMethod(): void self::assertSame(ClassHelper::SiteTree, $resultType->getClassName()); } - public function testLinkTrackingMethod(): void + public static function testLinkTrackingMethod(): void { - $classReflection = $this->broker->getClass(ClassHelper::SiteTree); - $methodReflection = $this->method->getMethod($classReflection, 'LinkTracking'); + $classReflection = self::$broker->getClass(ClassHelper::SiteTree); + $methodReflection = self::$method->getMethod($classReflection, 'LinkTracking'); self::assertSame('LinkTracking', $methodReflection->getName()); $dataListType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); self::assertSame(DataListType::class, get_class($dataListType)); From b679ffa229497ee73d0a8ed3579de0e1f60c5628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Tue, 7 Oct 2025 16:35:58 +0200 Subject: [PATCH 26/27] mod: shotgun static! --- tests/Reflection/MethodClassReflectionExtensionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Reflection/MethodClassReflectionExtensionTest.php b/tests/Reflection/MethodClassReflectionExtensionTest.php index fb94ab9..eef0c5a 100644 --- a/tests/Reflection/MethodClassReflectionExtensionTest.php +++ b/tests/Reflection/MethodClassReflectionExtensionTest.php @@ -11,11 +11,11 @@ class MethodClassReflectionExtensionTest extends TypeInferenceTestCase /** * @return iterable */ - public function dataFileAsserts(): iterable + public static function dataFileAsserts(): iterable { // path to a file with actual asserts of expected types: require_once(__DIR__ . '/data/method-class-reflection.php'); - yield from $this->gatherAssertTypes(__DIR__ . '/data/method-class-reflection.php'); + yield from self::gatherAssertTypes(__DIR__ . '/data/method-class-reflection.php'); } /** From 660056161eb4e5cb808d1f08d638c364aab39e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20C=C3=B4t=C3=A9?= Date: Tue, 7 Oct 2025 16:53:33 +0200 Subject: [PATCH 27/27] Revert "fix: statify testFileAsserts" This reverts commit 0ef09aa4da081f1eabd1182a0a7695cc5a6fd4f9. --- tests/Reflection/MethodClassReflectionExtensionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Reflection/MethodClassReflectionExtensionTest.php b/tests/Reflection/MethodClassReflectionExtensionTest.php index eef0c5a..c9343a8 100644 --- a/tests/Reflection/MethodClassReflectionExtensionTest.php +++ b/tests/Reflection/MethodClassReflectionExtensionTest.php @@ -21,12 +21,12 @@ public static function dataFileAsserts(): iterable /** * @dataProvider dataFileAsserts */ - public static function testFileAsserts( + public function testFileAsserts( string $assertType, string $file, ...$args ): void { - singleton(self::class)->assertFileAsserts($assertType, $file, ...$args); + $this->assertFileAsserts($assertType, $file, ...$args); } public static function getAdditionalConfigFiles(): array