From 42e1fe7dd0984b2a429efb88d55fb89e81883551 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 13:54:00 +0100 Subject: [PATCH 01/10] Update PHPCS and PHPCBF constraints to include ^4.0 --- phpcq-plugin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpcq-plugin.json b/phpcq-plugin.json index 26b1507..b03dd7e 100644 --- a/phpcq-plugin.json +++ b/phpcq-plugin.json @@ -10,7 +10,7 @@ }, "tool": { "phpcs": { - "constraints": "^3.0 || ^2.0", + "constraints": "^4.0 || ^3.0 || ^2.0", "sources": [ { "type": "github", @@ -19,7 +19,7 @@ ] }, "phpcbf": { - "constraints": "^3.0 || ^2.0", + "constraints": "^4.0 || ^3.0 || ^2.0", "sources": [ { "type": "github", From 4d6b641cd08a7f4052ff7bafcbd9f4a5812a4791 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 13:54:16 +0100 Subject: [PATCH 02/10] Update tools --- .phpcq.lock | 2 +- .phpcq.yaml.dist | 4 ++++ composer.lock | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.phpcq.lock b/.phpcq.lock index 4f06cc2..8a3a6bd 100644 --- a/.phpcq.lock +++ b/.phpcq.lock @@ -1 +1 @@ -{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpunit/phpunit-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"9.6.19","url":"https://phar.phpunit.de/phpunit-9.6.19.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"f30c21743f4fbea14ad8ab8f47673f9067117262dafa147fcb182e75fbc1c249"},"signature":"https://phar.phpunit.de/phpunit-9.6.19.phar.asc"}},"composerLock":null},"psalm":{"api-version":"1.0.0","version":"1.2.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/psalm/psalm-1.2.0.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0 || ^5.0"}},"checksum":{"type":"sha-512","value":"4a550c9226d7bca582d7c10bd87cce01190c96398936b1613421640c83df62ed1c6e0d44c1b39635414ea8cf4a892a6458d27590793238add24e7cb5547e6ffd"},"tools":{"psalm":{"version":"5.23.1","url":"https://github.com/vimeo/psalm/releases/download/5.23.1/psalm.phar","requirements":{"php":{"php":"^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/5.23.1/psalm.phar.asc"}},"composerLock":null},"composer-require-checker":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-require-checker/composer-require-checker-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8 || ^4.0"}},"checksum":{"type":"sha-512","value":"d5415bddfe024c5749d894034583882aee4e5c3e1087815d9fdd81cb5e71630f631a0e35de0ff84b97fbbf738c16ece5f83bd8c00695913eb846aa6f04577dc2"},"tools":{"composer-require-checker":{"version":"4.11.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.11.0/composer-require-checker.phar","requirements":{"php":{"php":"~8.2.0 || ~8.3.0","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.11.0/composer-require-checker.phar.asc"}},"composerLock":null},"phpmd":{"api-version":"1.0.0","version":"1.0.2.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpmd/phpmd-1.0.2.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"f22280a6dec8dbdd2ec1d83b294f23237fe32c34f4a298e52038e0a7a0074d541635b2b488b1a6098a42d8418a6cd8eb804406ea82b91e362be2b5d11a0915b0"},"tools":{"phpmd":{"version":"2.15.0","url":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar.asc"}},"composerLock":null},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcpd/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}},"composerLock":null},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phploc/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}},"composerLock":null},"phpcs":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"2737022369da1318cc4e0ea194e8a81019f7b079080d869aab878b7486052fdbe68fee3f28131f35573226def1aabd4bd005e038ee7b767c137b1107c1492a83"},"tools":{"phpcs":{"version":"3.9.1","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.9.1/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.9.1/phpcs.phar.asc"},"phpcbf":{"version":"3.9.1","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.9.1/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.9.1/phpcbf.phar.asc"}},"composerLock":null},"composer-normalize":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-normalize/composer-normalize-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d59d3557cb20630734878a9115df5dd32d5aff815e5b15be36f6fb5d6e9d83dd36efd84215ab6529edcc924f600946f739a0d9e67723deff95c88346ab502498"},"tools":{"composer-normalize":{"version":"2.42.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.42.0/composer-normalize.phar","requirements":{"php":{"php":"~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0","ext-json":"*"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.42.0/composer-normalize.phar.asc"}},"composerLock":null}},"tools":[]} \ No newline at end of file +{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpunit/phpunit-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"12.5.14","url":"https://phar.phpunit.de/phpunit-12.5.14.phar","requirements":{"php":{"php":">=8.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"2442777a2825e43338cd12aa586327203282184d43f823a5be8c3812c735c43b"},"signature":"https://phar.phpunit.de/phpunit-12.5.14.phar.asc"}},"composerLock":null},"psalm":{"api-version":"1.0.0","version":"1.3.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/psalm/psalm-1.3.0.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0 || ^5.0 || ^6.0"}},"checksum":{"type":"sha-512","value":"4a550c9226d7bca582d7c10bd87cce01190c96398936b1613421640c83df62ed1c6e0d44c1b39635414ea8cf4a892a6458d27590793238add24e7cb5547e6ffd"},"tools":{"psalm":{"version":"6.15.1","url":"https://github.com/vimeo/psalm/releases/download/6.15.1/psalm.phar","requirements":{"php":{"php":"~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/6.15.1/psalm.phar.asc"}},"composerLock":null},"composer-require-checker":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-require-checker/composer-require-checker-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8 || ^4.0"}},"checksum":{"type":"sha-512","value":"d5415bddfe024c5749d894034583882aee4e5c3e1087815d9fdd81cb5e71630f631a0e35de0ff84b97fbbf738c16ece5f83bd8c00695913eb846aa6f04577dc2"},"tools":{"composer-require-checker":{"version":"4.21.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.21.0/composer-require-checker.phar","requirements":{"php":{"php":"~8.4.0 || ~8.5.0","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.21.0/composer-require-checker.phar.asc"}},"composerLock":null},"phpmd":{"api-version":"1.0.0","version":"1.0.2.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpmd/phpmd-1.0.2.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"f22280a6dec8dbdd2ec1d83b294f23237fe32c34f4a298e52038e0a7a0074d541635b2b488b1a6098a42d8418a6cd8eb804406ea82b91e362be2b5d11a0915b0"},"tools":{"phpmd":{"version":"2.15.0","url":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar.asc"}},"composerLock":null},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcpd/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}},"composerLock":null},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phploc/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}},"composerLock":null},"phpcs":{"api-version":"1.0.0","version":"1.2.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.2.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"b6ed00306e76068a6af5e3b1dec837724f9e1900ef1049ce88e7ce195b0583524ca33a73613fba13244307a7ca853b6ddaa14ded69f651c3f184ac130bd1aaad"},"tools":{"phpcs":{"version":"3.13.5","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcs.phar.asc"},"phpcbf":{"version":"3.13.5","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcbf.phar.asc"}},"composerLock":null},"composer-normalize":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-normalize/composer-normalize-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d9abda440b85d501c58abf9c81bf76f417594b397129215ffa8b777e9bb5e5eda37d7661d661db3c8d11c24f20345bc6fbe56f013b3b9435d459d2b94f086e0f"},"tools":{"composer-normalize":{"version":"2.50.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.50.0/composer-normalize.phar","requirements":{"php":{"php":"~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0","ext-json":"*"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.50.0/composer-normalize.phar.asc"}},"composerLock":null}},"tools":[]} \ No newline at end of file diff --git a/.phpcq.yaml.dist b/.phpcq.yaml.dist index 9770b80..2a9a596 100644 --- a/.phpcq.yaml.dist +++ b/.phpcq.yaml.dist @@ -39,16 +39,20 @@ phpcq: # psalm - 8A03EA3B385DBAA1 - 12CE0F1D262429A5 + - 99BF4D9A33D65E1E # magl@magll.net - D2CCAC42F6295E7D # PHP_CodeSniffer - 31C7E470E2138192 - 5E6DDE998AB73B8E + - 97B02DD8E5071466 # Composer normalize - C00543248C87FB13 # phpmd - 0F9684B8B16B7AB0 - 9093F8B32E4815AA + # phpcq + - 6659B17090D6C5D3 tasks: fix: diff --git a/composer.lock b/composer.lock index 6bec019..a48a7ef 100644 --- a/composer.lock +++ b/composer.lock @@ -204,6 +204,6 @@ "php": "^7.4 || ^8.0", "ext-pcre": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From 8a2a172fd7412b0668380b6665d9faa7ce10f61e Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 13:59:15 +0100 Subject: [PATCH 03/10] Fix issues detected by psalm --- src/phpcs.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/phpcs.php b/src/phpcs.php index 2b2e01a..9168361 100644 --- a/src/phpcs.php +++ b/src/phpcs.php @@ -16,11 +16,13 @@ use Phpcq\PluginApi\Version10\Util\CheckstyleReportAppender; return new class implements DiagnosticsPluginInterface, ExecPluginInterface { + #[\Override] public function getName(): string { return 'phpcs'; } + #[\Override] public function describeConfiguration(PluginConfigurationBuilderInterface $configOptionsBuilder): void { $configOptionsBuilder->supportDirectories(); @@ -70,6 +72,7 @@ public function describeConfiguration(PluginConfigurationBuilderInterface $confi ); } + #[\Override] public function createDiagnosticTasks( PluginConfigurationInterface $config, EnvironmentInterface $environment @@ -131,7 +134,8 @@ private function buildArguments( $arguments[] = 'installed_paths'; $arguments[] = implode(',', array_map( function ($path) use ($projectPath): string { - return realpath($projectPath . '/' . $path); + $resolved = realpath($projectPath . '/' . $path); + return $resolved !== false ? $resolved : $projectPath . '/' . $path; }, $standardPaths, )); @@ -173,6 +177,7 @@ function (string $path) use ($environment): string { return array_merge($arguments, $config->getStringList('directories')); } + #[\Override] public function describeExecTask( ExecTaskDefinitionBuilderInterface $definitionBuilder, EnvironmentInterface $environment @@ -193,6 +198,7 @@ public function describeExecTask( ); } + #[\Override] public function createExecTask( ?string $application, array $arguments, @@ -244,6 +250,7 @@ private function createHelpParser(): OutputInterface /** @var array */ private $arguments = []; + #[\Override] public function write( string $message, int $verbosity = self::VERBOSITY_NORMAL, @@ -254,6 +261,7 @@ public function write( } } + #[\Override] public function writeln( string $message, int $verbosity = self::VERBOSITY_NORMAL, From bcd39ccf97fc91968801ddb4b72534ec65cbdf4d Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 13:59:24 +0100 Subject: [PATCH 04/10] Replace `getMockForAbstractClass` with `createMock` in unit tests --- tests/PhpcsPluginTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/PhpcsPluginTest.php b/tests/PhpcsPluginTest.php index 196c2f3..67f334c 100644 --- a/tests/PhpcsPluginTest.php +++ b/tests/PhpcsPluginTest.php @@ -33,7 +33,7 @@ public function testPluginName(): void public function testPluginDescribesConfig(): void { - $configOptionsBuilder = $this->getMockForAbstractClass(PluginConfigurationBuilderInterface::class); + $configOptionsBuilder = $this->createMock(PluginConfigurationBuilderInterface::class); $this->instantiate()->describeConfiguration($configOptionsBuilder); @@ -43,8 +43,8 @@ public function testPluginDescribesConfig(): void public function testPluginCreatesDiagnosticTasks(): void { - $config = $this->getMockForAbstractClass(PluginConfigurationInterface::class); - $environment = $this->getMockForAbstractClass(EnvironmentInterface::class); + $config = $this->createMock(PluginConfigurationInterface::class); + $environment = $this->createMock(EnvironmentInterface::class); $this->instantiate()->createDiagnosticTasks($config, $environment); @@ -55,7 +55,7 @@ public function testPluginCreatesDiagnosticTasks(): void public function testConfigureAutoloadPaths(): void { - $config = $this->getMockForAbstractClass(PluginConfigurationInterface::class); + $config = $this->createMock(PluginConfigurationInterface::class); $config->method('has')->willReturnCallback(static function (string $key) { if ($key === 'autoload_paths') { return true; @@ -72,10 +72,10 @@ public function testConfigureAutoloadPaths(): void return []; }); - $configuration = $this->getMockForAbstractClass(ProjectConfigInterface::class); + $configuration = $this->createMock(ProjectConfigInterface::class); $configuration->method('getProjectRootPath')->willReturn(__DIR__ . '/fixtures'); - $environment = $this->getMockForAbstractClass(EnvironmentInterface::class); + $environment = $this->createMock(EnvironmentInterface::class); $environment->method('getUniqueTempFile')->willReturn(tempnam(sys_get_temp_dir(), 'phpcq-phpcs')); $environment->method('getProjectConfiguration')->willReturn($configuration); From 57cb7fd8741c7cd2ed5465007d221456bd6e8210 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 14:02:59 +0100 Subject: [PATCH 05/10] Add PHP 8.4 and 8.5 to the test matrix in diagnostics workflow --- .github/workflows/diagnostics.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index 22b73c5..d155e78 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -31,6 +31,12 @@ jobs: - php: 8.3 output: '-o github-action -o default' phpcq_install: 'update' + - php: 8.4 + output: '-o github-action -o default' + phpcq_install: 'update' + - php: 8.5 + output: '-o github-action -o default' + phpcq_install: 'update' steps: - name: Pull source uses: actions/checkout@v2 From ae10b7bfab4ab4919062033f995a8113df205a1a Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 14:03:05 +0100 Subject: [PATCH 06/10] Add Dependabot configuration for Composer and GitHub Actions --- .github/dependabot.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..de900e1 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,23 @@ +# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 + +updates: + - commit-message: + include: "scope" + prefix: "composer" + directory: "/" + open-pull-requests-limit: 0 + package-ecosystem: "composer" + schedule: + interval: "weekly" + versioning-strategy: "increase" + + - commit-message: + include: "scope" + prefix: "github-actions" + directory: "/" + open-pull-requests-limit: 10 + package-ecosystem: "github-actions" + schedule: + interval: "weekly" From 6925356657239cdb47c9d1c9f4f0386a353182fd Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 14:04:42 +0100 Subject: [PATCH 07/10] Update GitHub Actions to latest versions of used actions in diagnostics workflow --- .github/workflows/diagnostics.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index d155e78..d1e8fa2 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -39,7 +39,7 @@ jobs: phpcq_install: 'update' steps: - name: Pull source - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 @@ -47,7 +47,7 @@ jobs: php-version: ${{ matrix.php }} - name: Cache composer cache directory - uses: actions/cache@v1 + uses: actions/cache@v4 env: cache-name: composer-cache-dir-${{ matrix.php }} with: @@ -55,7 +55,7 @@ jobs: key: ${{ runner.os }}-build-${{ env.cache-name }} - name: Cache vendor directory - uses: actions/cache@v1 + uses: actions/cache@v4 env: cache-name: vendor-${{ matrix.php }} with: @@ -65,7 +65,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- - name: Cache phpcq directory - uses: actions/cache@v1 + uses: actions/cache@v4 env: cache-name: phpcq-${{ matrix.php }} with: @@ -84,7 +84,7 @@ jobs: run: ./vendor/bin/phpcq run -v ${{ matrix.output }} - name: Upload build directory to artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v7 if: ${{ success() }} || ${{ failure() }} with: name: phpcq-builds-php-${{ matrix.php }} From ea5f63bb080e17f9ea5adbdfb0ec6adf085cddfe Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 14:07:19 +0100 Subject: [PATCH 08/10] Cast `getAvailableThreads` result to int in PHPCS arguments --- src/phpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phpcs.php b/src/phpcs.php index 9168361..a70dd83 100644 --- a/src/phpcs.php +++ b/src/phpcs.php @@ -141,7 +141,7 @@ function ($path) use ($projectPath): string { )); } - $arguments[] = '--parallel=' . $environment->getAvailableThreads(); + $arguments[] = '--parallel=' . ((int) $environment->getAvailableThreads()); if (null !== $tempFile) { $arguments[] = '--report=checkstyle'; $arguments[] = '--report-file=' . $tempFile; From 35f1768dc50ae019c11919b21b154138b2cdabfd Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 14:07:25 +0100 Subject: [PATCH 09/10] Remove PHP 7.4 and 8.0 from the test matrix in diagnostics workflow --- .github/workflows/diagnostics.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index d1e8fa2..b104ea2 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -16,12 +16,6 @@ jobs: fail-fast: false matrix: include: - - php: 7.4 - output: '-o github-action -o default' - phpcq_install: 'update' - - php: 8.0 - output: '-o github-action -o default' - phpcq_install: 'update' - php: 8.1 output: '-o github-action -o default' phpcq_install: 'update' From adc5d26f997e682d861193b876af28b46b57f7fc Mon Sep 17 00:00:00 2001 From: David Molineus Date: Wed, 4 Mar 2026 14:09:36 +0100 Subject: [PATCH 10/10] Cast `getAvailableThreads` result to string in PHPCS arguments --- src/phpcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phpcs.php b/src/phpcs.php index a70dd83..10eadf6 100644 --- a/src/phpcs.php +++ b/src/phpcs.php @@ -141,7 +141,7 @@ function ($path) use ($projectPath): string { )); } - $arguments[] = '--parallel=' . ((int) $environment->getAvailableThreads()); + $arguments[] = '--parallel=' . ((string) $environment->getAvailableThreads()); if (null !== $tempFile) { $arguments[] = '--report=checkstyle'; $arguments[] = '--report-file=' . $tempFile;