From 9f77416059aeb29e854470f8c9bf80c197688a86 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 4 Sep 2026 09:27:48 +0200 Subject: [PATCH 1/7] Update minimum required PHP version --- .github/workflows/diagnostics.yml | 12 +++++++----- composer.json | 2 +- composer.lock | 32 +++++++++++++++---------------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index f799c4c..b950110 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -16,13 +16,15 @@ jobs: fail-fast: false matrix: include: - - php: 7.4 - output: '-o github-action -o default' - phpcq_install: 'install' - - php: 8.0 + - php: 8.3 + output: '-o default' + phpcq_install: 'update' + - php: 8.4 + output: '-o default' + phpcq_install: 'update' + - php: 8.5 output: '-o default' phpcq_install: 'update' - steps: - name: Pull source uses: actions/checkout@v2 diff --git a/composer.json b/composer.json index 3be6fa9..4380438 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^8.3", "ext-json": "*", "phpcq/plugin-api": "^1.0@dev" }, diff --git a/composer.lock b/composer.lock index 4c6e8b5..90083de 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/phpcq/plugin-api.git", - "reference": "fb5707797635527a3e7af3561936688bf53cc33d" + "reference": "5cdbbbcea41191533e8c2bee4a61a73d731df0bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpcq/plugin-api/zipball/fb5707797635527a3e7af3561936688bf53cc33d", - "reference": "fb5707797635527a3e7af3561936688bf53cc33d", + "url": "https://api.github.com/repos/phpcq/plugin-api/zipball/5cdbbbcea41191533e8c2bee4a61a73d731df0bb", + "reference": "5cdbbbcea41191533e8c2bee4a61a73d731df0bb", "shasum": "" }, "require": { @@ -60,7 +60,7 @@ "description": "PHP code quality project plugin API interfaces.", "support": { "issues": "https://github.com/phpcq/plugin-api/issues", - "source": "https://github.com/phpcq/plugin-api/tree/master" + "source": "https://github.com/phpcq/plugin-api/tree/1.0.3" }, "funding": [ { @@ -72,7 +72,7 @@ "type": "github" } ], - "time": "2021-11-04T14:19:28+00:00" + "time": "2024-03-21T08:35:42+00:00" } ], "packages-dev": [ @@ -82,12 +82,12 @@ "source": { "type": "git", "url": "https://github.com/phpcq/runner-bootstrap.git", - "reference": "f0664b84c7324e2d41d653939ad3bf4f97aaf06f" + "reference": "aa201ff5719ddc2aad060b6a4b0689bacbca37c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpcq/runner-bootstrap/zipball/f0664b84c7324e2d41d653939ad3bf4f97aaf06f", - "reference": "f0664b84c7324e2d41d653939ad3bf4f97aaf06f", + "url": "https://api.github.com/repos/phpcq/runner-bootstrap/zipball/aa201ff5719ddc2aad060b6a4b0689bacbca37c6", + "reference": "aa201ff5719ddc2aad060b6a4b0689bacbca37c6", "shasum": "" }, "require": { @@ -136,7 +136,7 @@ "type": "github" } ], - "time": "2021-10-08T18:33:27+00:00" + "time": "2022-01-21T11:15:13+00:00" }, { "name": "phpcq/schema", @@ -144,12 +144,12 @@ "source": { "type": "git", "url": "https://github.com/phpcq/schema.git", - "reference": "3c0ce7ec8e4399b4800b418efe9300210c253cbe" + "reference": "3d6653acd4be5ef04ef1d04ef48c878354f2802e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpcq/schema/zipball/3c0ce7ec8e4399b4800b418efe9300210c253cbe", - "reference": "3c0ce7ec8e4399b4800b418efe9300210c253cbe", + "url": "https://api.github.com/repos/phpcq/schema/zipball/3d6653acd4be5ef04ef1d04ef48c878354f2802e", + "reference": "3d6653acd4be5ef04ef1d04ef48c878354f2802e", "shasum": "" }, "default-branch": true, @@ -180,7 +180,7 @@ "description": "phpcq schema files", "support": { "issues": "https://github.com/phpcq/schema/issues", - "source": "https://github.com/phpcq/schema/tree/1.0.0" + "source": "https://github.com/phpcq/schema/tree/master" }, "funding": [ { @@ -192,7 +192,7 @@ "type": "github" } ], - "time": "2021-08-17T19:02:55+00:00" + "time": "2025-09-25T07:14:36+00:00" } ], "aliases": [], @@ -208,6 +208,6 @@ "php": "^7.3 || ^8.0", "ext-json": "*" }, - "platform-dev": [], - "plugin-api-version": "2.2.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } From 8c9565250ff2d96e57231adc81e9571a3908e50d Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 4 Sep 2026 09:28:01 +0200 Subject: [PATCH 2/7] Update phpcq tools and fix unit tests --- .phpcq.lock | 2 +- .phpcq.yaml.dist | 3 +++ tests/DeptracPluginTest.php | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.phpcq.lock b/.phpcq.lock index 5b15b87..7ecf0df 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/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.5.11","url":"https://phar.phpunit.de/phpunit-9.5.11.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"e74ea97cf904f72e537de2778fa70ad94651580879bdc04386fd2ae62d7e03a5"},"signature":"https://phar.phpunit.de/phpunit-9.5.11.phar.asc"}}},"psalm":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/psalm-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0"}},"checksum":{"type":"sha-512","value":"fb591fbea784d65ea1b63ba597616c2dd6346958a61a9129aacf612e0deaa14c0de33d9a37cf81b5ed717f09cc3f1280149a0d46576fc838241070176710675f"},"tools":{"psalm":{"version":"v4.15.0","url":"https://github.com/vimeo/psalm/releases/download/v4.15.0/psalm.phar","requirements":{"php":{"php":"^7.1|^8","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/v4.15.0/psalm.phar.asc"}}},"composer-require-checker":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-require-checker-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"composer-require-checker":"^3.0 | ^2.0"}},"checksum":{"type":"sha-512","value":"39507e83aee0cad92c00dcb4c755bd39c1a9157bbd919e2092aaf81b02bc5a84693335d8f3a73427e66c08c12ff81e35ed4be2d05ff33f2d368229c220a1307a"},"tools":{"composer-require-checker":{"version":"3.8.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.8.0/composer-require-checker.phar","requirements":{"php":{"php":"^7.4 || ^8.0","ext-json":"*","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.8.0/composer-require-checker.phar.asc"}}},"phpmd":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/phpmd-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"88e267b9c36b2edc85e924717606b626e005ac8d97b1f65f5331e2a3b3894dec2cf124f6187541bf759d026477b6d94daacc5d5c81bb09714a68ffabe5698dc5"},"tools":{"phpmd":{"version":"2.11.1","url":"https://github.com/phpmd/phpmd/releases/download/2.11.1/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":null}}},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/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"}}},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/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"}}},"phpcs":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcs-1.1.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":"2737022369da1318cc4e0ea194e8a81019f7b079080d869aab878b7486052fdbe68fee3f28131f35573226def1aabd4bd005e038ee7b767c137b1107c1492a83"},"tools":{"phpcs":{"version":"3.6.2","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcs.phar.asc"},"phpcbf":{"version":"3.6.2","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcbf.phar.asc"}}},"composer-normalize":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-normalize-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"0a84b8656028b285000fa75d1f0e19a5efb156a9a738f4d41a738edb093ea8b5c392875b1167b8dbe4f644de09d6b2dfe1c39ca98f9f741dbcef2127a6f5e448"},"tools":{"composer-normalize":{"version":"2.23.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.0/composer-normalize.phar","requirements":{"php":{"php":"^7.4 || ^8.0"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.0/composer-normalize.phar.asc"}}}},"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.34","url":"https://phar.phpunit.de/phpunit-12.5.34.phar","requirements":{"php":{"php":">=8.3","ext-dom":"*","ext-filter":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"78295dc70de4b29f3362c70b2da77e6334e17b5d265a4dc827d953b0bdad4885"},"signature":"https://phar.phpunit.de/phpunit-12.5.34.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.16.1","url":"https://github.com/vimeo/psalm/releases/download/6.16.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.16.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.24.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.24.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.24.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.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.2.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^4.0 || ^3.0 || ^2.0","phpcbf":"^4.0 || ^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"03f1c6c2d94b79d0e8cbd42996382e0d100c7e07f84c3138fa3a8b394e814ec18ce05cbbd257e527913219b2264f062522e4cf3e3bd402b907b9437d96982b44"},"tools":{"phpcs":{"version":"4.0.4","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/4.0.4/phpcs.phar","requirements":{"php":{"php":">=7.2.0","ext-libxml":"*","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/4.0.4/phpcs.phar.asc"},"phpcbf":{"version":"4.0.4","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/4.0.4/phpcbf.phar","requirements":{"php":{"php":">=7.2.0","ext-libxml":"*","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/4.0.4/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.52.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.52.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.52.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 6316098..cebfd26 100644 --- a/.phpcq.yaml.dist +++ b/.phpcq.yaml.dist @@ -42,14 +42,17 @@ phpcq: # psalm - 8A03EA3B385DBAA1 - 12CE0F1D262429A5 + - 99BF4D9A33D65E1E # magl@magll.net - D2CCAC42F6295E7D # PHP_CodeSniffer - 31C7E470E2138192 + - 96E91A992CF22FF4 # Composer normalize - C00543248C87FB13 # phpmd - 0F9684B8B16B7AB0 + - 9093F8B32E4815AA tasks: fix: diff --git a/tests/DeptracPluginTest.php b/tests/DeptracPluginTest.php index 0ad522c..9b5a866 100644 --- a/tests/DeptracPluginTest.php +++ b/tests/DeptracPluginTest.php @@ -27,7 +27,7 @@ public function testPluginName(): void public function testPluginDescribesConfig(): void { - $configOptionsBuilder = $this->getMockForAbstractClass(PluginConfigurationBuilderInterface::class); + $configOptionsBuilder = $this->createMock(PluginConfigurationBuilderInterface::class); $this->instantiate()->describeConfiguration($configOptionsBuilder); @@ -37,8 +37,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); From e17ed66efc19df421188a695aef39c1b1a99aa72 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 4 Sep 2026 10:22:45 +0200 Subject: [PATCH 3/7] Support deptrac 4.x via Composer requirement deptrac stopped shipping a PHAR release asset with 3.0, so the previous GitHub tool source (constraint ^0.19, repository qossmic/deptrac) can no longer provide a usable binary. - phpcq-plugin.json: replace the tool/PHAR source with a composer requirement (deptrac/deptrac ^4.0); raise PHP requirement to ^8.3 and declare ext-json - src/deptrac.php: run the composer-installed vendor/bin/deptrac through buildPhpProcess() instead of buildRunPhar(); mention deptrac.php in the config-file option description - tests: replace the smoke tests with assertions covering the described configuration options and the built process invocation (binary path, base arguments, optional argument handling) - README: note the Composer-based tool acquisition --- README.md | 5 +- phpcq-plugin.json | 15 +--- src/deptrac.php | 5 +- tests/DeptracPluginTest.php | 155 +++++++++++++++++++++++++++++++++--- 4 files changed, 156 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index aefe96b..bbbc22a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # deptrac plugin for phpcq. -This plugin provides [deptrac](https://github.com/qossmic/deptrac) integration for phpcq. +This plugin provides [deptrac](https://github.com/deptrac/deptrac) integration for phpcq. + +Since deptrac no longer ships a PHAR, the plugin pulls in `deptrac/deptrac` (`^4.0`) as a +Composer requirement and runs the installed `vendor/bin/deptrac` through the PHP interpreter. diff --git a/phpcq-plugin.json b/phpcq-plugin.json index 065d16e..fe8cac0 100644 --- a/phpcq-plugin.json +++ b/phpcq-plugin.json @@ -5,18 +5,11 @@ "api-version": "1.0.0", "requirements": { "php": { - "php": "^7.3 || ^8.0" + "php": "^8.3", + "ext-json": "*" }, - "tool": { - "deptrac": { - "constraints": "^0.19", - "sources": [ - { - "type": "github", - "repository": "qossmic/deptrac" - } - ] - } + "composer": { + "deptrac/deptrac": "^4.0" } } } diff --git a/src/deptrac.php b/src/deptrac.php index 6644888..92845c5 100644 --- a/src/deptrac.php +++ b/src/deptrac.php @@ -20,7 +20,7 @@ public function getName(): string public function describeConfiguration(PluginConfigurationBuilderInterface $configOptionsBuilder): void { $configOptionsBuilder - ->describeStringOption('config-file', 'Path to the config file (Default deptrac.yaml)'); + ->describeStringOption('config-file', 'Path to the config file (Default deptrac.yaml or deptrac.php)'); $configOptionsBuilder->describeStringOption('cache-file', 'Path to the cache file'); @@ -48,6 +48,7 @@ public function createDiagnosticTasks( $projectRoot = $environment->getProjectConfiguration()->getProjectRootPath(); $outputFile = $environment->getUniqueTempFile($this, 'report.json'); $arguments = [ + $environment->getInstalledDir() . '/vendor/bin/deptrac', 'analyse', '--no-progress', '--formatter=json', @@ -79,7 +80,7 @@ public function createDiagnosticTasks( } yield $environment->getTaskFactory() - ->buildRunPhar('deptrac', $arguments) + ->buildPhpProcess('deptrac', $arguments) ->withWorkingDirectory($projectRoot) ->withOutputTransformer($this->createOutputTransformer($projectRoot, $outputFile)) ->build(); diff --git a/tests/DeptracPluginTest.php b/tests/DeptracPluginTest.php index 9b5a866..9d2e87c 100644 --- a/tests/DeptracPluginTest.php +++ b/tests/DeptracPluginTest.php @@ -4,10 +4,16 @@ namespace Phpcq\DeptracPluginTest; +use Phpcq\PluginApi\Version10\Configuration\Builder\BoolOptionBuilderInterface; +use Phpcq\PluginApi\Version10\Configuration\Builder\StringOptionBuilderInterface; use Phpcq\PluginApi\Version10\Configuration\PluginConfigurationBuilderInterface; use Phpcq\PluginApi\Version10\Configuration\PluginConfigurationInterface; use Phpcq\PluginApi\Version10\DiagnosticsPluginInterface; use Phpcq\PluginApi\Version10\EnvironmentInterface; +use Phpcq\PluginApi\Version10\ProjectConfigInterface; +use Phpcq\PluginApi\Version10\Task\PhpTaskBuilderInterface; +use Phpcq\PluginApi\Version10\Task\TaskFactoryInterface; +use Phpcq\PluginApi\Version10\Task\TaskInterface; use PHPUnit\Framework\TestCase; /** @@ -25,24 +31,153 @@ public function testPluginName(): void self::assertSame('deptrac', $this->instantiate()->getName()); } - public function testPluginDescribesConfig(): void + public function testPluginDescribesAllConfigurationOptions(): void { - $configOptionsBuilder = $this->createMock(PluginConfigurationBuilderInterface::class); + $stringOptions = []; + $boolOptions = []; + + $configOptionsBuilder = $this->createStub(PluginConfigurationBuilderInterface::class); + $configOptionsBuilder + ->method('describeStringOption') + ->willReturnCallback(function (string $name) use (&$stringOptions): StringOptionBuilderInterface { + $stringOptions[] = $name; + + return $this->createStub(StringOptionBuilderInterface::class); + }); + $configOptionsBuilder + ->method('describeBoolOption') + ->willReturnCallback(function (string $name) use (&$boolOptions): BoolOptionBuilderInterface { + $boolOptions[] = $name; + + return $this->createStub(BoolOptionBuilderInterface::class); + }); $this->instantiate()->describeConfiguration($configOptionsBuilder); - // We assume it worked out as the plugin did execute correctly. - $this->addToAssertionCount(1); + self::assertSame(['config-file', 'cache-file'], $stringOptions); + self::assertSame( + ['no-cache', 'fail-on-uncovered', 'report-uncovered', 'report-skipped'], + $boolOptions + ); + } + + public function testPluginCreatesExactlyOneDiagnosticTask(): void + { + [$tasks] = $this->runCreateDiagnosticTasks($this->createStub(PluginConfigurationInterface::class)); + + self::assertCount(1, $tasks); + self::assertInstanceOf(TaskInterface::class, $tasks[0]); + } + + public function testDiagnosticTaskRunsComposerInstalledBinaryAsPhpProcess(): void + { + [, $toolName, $command] = $this->runCreateDiagnosticTasks( + $this->createStub(PluginConfigurationInterface::class) + ); + + self::assertSame('deptrac', $toolName); + self::assertSame('/installed-dir/vendor/bin/deptrac', $command[0]); + } + + public function testDiagnosticTaskBuildsBaseArgumentsWithoutOptionalConfiguration(): void + { + // A bare config where has() returns false for every option. + [, , $command] = $this->runCreateDiagnosticTasks( + $this->createStub(PluginConfigurationInterface::class) + ); + + self::assertSame( + [ + '/installed-dir/vendor/bin/deptrac', + 'analyse', + '--no-progress', + '--formatter=json', + '--output=/tmp/deptrac-report.json', + ], + $command + ); } - public function testPluginCreatesDiagnosticTasks(): void + public function testDiagnosticTaskAppendsConfiguredArguments(): void { - $config = $this->createMock(PluginConfigurationInterface::class); - $environment = $this->createMock(EnvironmentInterface::class); + $config = $this->createStub(PluginConfigurationInterface::class); + $config->method('has')->willReturn(true); + $config->method('getBool')->willReturn(true); + $config->method('getString')->willReturnMap([ + ['config-file', 'config/deptrac.yaml'], + ['cache-file', 'var/deptrac.cache'], + ]); + + [, , $command] = $this->runCreateDiagnosticTasks($config); + + self::assertContains('--config-file=config/deptrac.yaml', $command); + self::assertContains('--no-cache', $command); + self::assertContains('--cache-file=var/deptrac.cache', $command); + self::assertContains('--fail-on-uncovered', $command); + self::assertContains('--report-uncovered', $command); + self::assertContains('--report-skipped', $command); + } + + public function testDiagnosticTaskOmitsDisabledBooleanArguments(): void + { + $config = $this->createStub(PluginConfigurationInterface::class); + // Options are present, but every boolean switch is turned off. + $config->method('has')->willReturnMap([ + ['config-file', false], + ['cache-file', false], + ['no-cache', true], + ['fail-on-uncovered', true], + ['report-uncovered', true], + ['report-skipped', true], + ]); + $config->method('getBool')->willReturn(false); + + [, , $command] = $this->runCreateDiagnosticTasks($config); + + self::assertNotContains('--no-cache', $command); + self::assertNotContains('--fail-on-uncovered', $command); + self::assertNotContains('--report-uncovered', $command); + self::assertNotContains('--report-skipped', $command); + } + + /** + * Executes createDiagnosticTasks() with a stubbed environment and captures the process invocation. + * + * @return array{0: list, 1: string, 2: list} + */ + private function runCreateDiagnosticTasks(PluginConfigurationInterface $config): array + { + $toolName = ''; + $command = []; + + $taskBuilder = $this->createStub(PhpTaskBuilderInterface::class); + $taskBuilder->method('withWorkingDirectory')->willReturnSelf(); + $taskBuilder->method('withOutputTransformer')->willReturnSelf(); + $taskBuilder->method('build')->willReturn($this->createStub(TaskInterface::class)); + + $taskFactory = $this->createStub(TaskFactoryInterface::class); + $taskFactory + ->method('buildPhpProcess') + ->willReturnCallback( + function (string $tool, array $cmd) use (&$toolName, &$command, $taskBuilder): PhpTaskBuilderInterface { + $toolName = $tool; + $command = $cmd; + + return $taskBuilder; + } + ); + + $projectConfig = $this->createStub(ProjectConfigInterface::class); + $projectConfig->method('getProjectRootPath')->willReturn('/project-root'); + + $environment = $this->createStub(EnvironmentInterface::class); + $environment->method('getProjectConfiguration')->willReturn($projectConfig); + $environment->method('getTaskFactory')->willReturn($taskFactory); + $environment->method('getInstalledDir')->willReturn('/installed-dir'); + $environment->method('getUniqueTempFile')->willReturn('/tmp/deptrac-report.json'); - $this->instantiate()->createDiagnosticTasks($config, $environment); + $tasks = iterator_to_array($this->instantiate()->createDiagnosticTasks($config, $environment), false); - // We assume it worked out as the plugin did execute correctly. - $this->addToAssertionCount(1); + return [$tasks, $toolName, $command]; } } From 45af7b54c7c52c1afa87330261ec141d582ebc67 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 4 Sep 2026 10:31:02 +0200 Subject: [PATCH 4/7] Update github actions configuration using latest actions --- .github/workflows/diagnostics.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index b950110..4aa7571 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -17,17 +17,17 @@ jobs: matrix: include: - php: 8.3 - output: '-o default' + output: '-o github-action -o default' phpcq_install: 'update' - php: 8.4 - output: '-o default' + output: '-o github-action -o default' phpcq_install: 'update' - php: 8.5 - output: '-o default' + output: '-o github-action -o default' phpcq_install: 'update' steps: - name: Pull source - uses: actions/checkout@v2 + uses: actions/checkout@v7 - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 @@ -35,7 +35,7 @@ jobs: php-version: ${{ matrix.php }} - name: Cache composer cache directory - uses: actions/cache@v1 + uses: actions/cache@v6 env: cache-name: composer-cache-dir-${{ matrix.php }} with: @@ -43,7 +43,7 @@ jobs: key: ${{ runner.os }}-build-${{ env.cache-name }} - name: Cache vendor directory - uses: actions/cache@v1 + uses: actions/cache@v6 env: cache-name: vendor-${{ matrix.php }} with: @@ -53,7 +53,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- - name: Cache phpcq directory - uses: actions/cache@v1 + uses: actions/cache@v6 env: cache-name: phpcq-${{ matrix.php }} with: @@ -65,9 +65,6 @@ jobs: - name: Install composer dependencies run: composer install - - name: Update phpcq - run: ./vendor/bin/phpcq self-update - - name: Install phpcq toolchain run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v @@ -75,8 +72,8 @@ jobs: run: ./vendor/bin/phpcq run -v ${{ matrix.output }} - name: Upload build directory to artifact - uses: actions/upload-artifact@v2 - if: ${{ success() }} || ${{ failure() }} + uses: actions/upload-artifact@v7 + if: ${{ success() || failure() }} with: name: phpcq-builds-php-${{ matrix.php }} path: .phpcq/build/ From f9fb898333c1db25b1cf8425d8bae740fd0a007e Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 4 Sep 2026 10:31:38 +0200 Subject: [PATCH 5/7] Add dependabot.yaml configuration --- .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..122ea42 --- /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" \ No newline at end of file From 03777477b5947050bad6fa58bf46758e17a165fb Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 4 Sep 2026 10:33:36 +0200 Subject: [PATCH 6/7] Update composer dependencies --- composer.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 90083de..a2875b3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "75972abff4651f67c5a9686d772c3904", + "content-hash": "9388ab6766329a44767467324267e53e", "packages": [ { "name": "phpcq/plugin-api", @@ -205,7 +205,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3 || ^8.0", + "php": "^8.3", "ext-json": "*" }, "platform-dev": {}, From 926fd99112761eccbabea069826963dcb6ec09ce Mon Sep 17 00:00:00 2001 From: David Molineus Date: Tue, 8 Sep 2026 11:45:26 +0200 Subject: [PATCH 7/7] Use stable versions --- composer.json | 4 ++-- composer.lock | 22 +++++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 4380438..17375c7 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,11 @@ "require": { "php": "^8.3", "ext-json": "*", - "phpcq/plugin-api": "^1.0@dev" + "phpcq/plugin-api": "^1.0" }, "require-dev": { "phpcq/runner-bootstrap": "^1.0@dev", - "phpcq/schema": "^1.0@dev" + "phpcq/schema": "^1.0" }, "autoload-dev": { "psr-4": { diff --git a/composer.lock b/composer.lock index a2875b3..50600b8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,11 +4,11 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9388ab6766329a44767467324267e53e", + "content-hash": "8f99bdf1bd59c36141da737de675ec32", "packages": [ { "name": "phpcq/plugin-api", - "version": "dev-master", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phpcq/plugin-api.git", @@ -27,7 +27,6 @@ "require-dev": { "phpcq/runner-bootstrap": "^1.0@dev" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -140,19 +139,18 @@ }, { "name": "phpcq/schema", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/phpcq/schema.git", - "reference": "3d6653acd4be5ef04ef1d04ef48c878354f2802e" + "reference": "3c0ce7ec8e4399b4800b418efe9300210c253cbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpcq/schema/zipball/3d6653acd4be5ef04ef1d04ef48c878354f2802e", - "reference": "3d6653acd4be5ef04ef1d04ef48c878354f2802e", + "url": "https://api.github.com/repos/phpcq/schema/zipball/3c0ce7ec8e4399b4800b418efe9300210c253cbe", + "reference": "3c0ce7ec8e4399b4800b418efe9300210c253cbe", "shasum": "" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -180,7 +178,7 @@ "description": "phpcq schema files", "support": { "issues": "https://github.com/phpcq/schema/issues", - "source": "https://github.com/phpcq/schema/tree/master" + "source": "https://github.com/phpcq/schema/tree/1.0.0" }, "funding": [ { @@ -192,15 +190,13 @@ "type": "github" } ], - "time": "2025-09-25T07:14:36+00:00" + "time": "2021-08-17T19:02:55+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { - "phpcq/plugin-api": 20, - "phpcq/runner-bootstrap": 20, - "phpcq/schema": 20 + "phpcq/runner-bootstrap": 20 }, "prefer-stable": false, "prefer-lowest": false,