From d07554ef28de424b177aeaaf8906adfdd885044d Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 18:35:13 +0200 Subject: [PATCH 1/9] Bump tool restrictions and keys --- .phpcq.yaml.dist | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.phpcq.yaml.dist b/.phpcq.yaml.dist index 6316098..f274002 100644 --- a/.phpcq.yaml.dist +++ b/.phpcq.yaml.dist @@ -19,9 +19,6 @@ phpcq: phpmd: version: ^1.0 signed: false - requirements: - phpmd: - signed: false phpcpd: version: ^1.1.1 signed: false @@ -46,10 +43,12 @@ phpcq: - D2CCAC42F6295E7D # PHP_CodeSniffer - 31C7E470E2138192 + - 5E6DDE998AB73B8E # Composer normalize - C00543248C87FB13 # phpmd - 0F9684B8B16B7AB0 + - 9093F8B32E4815AA tasks: fix: From f436f8ec8f52e0d7fc8f59b5fcbb6d43d3d9bb1c Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 18:40:56 +0200 Subject: [PATCH 2/9] Fix output parsing This: - strips any ansi code - parses the diff correctly - discards more irrelevant messages --- src/composer-normalize.php | 60 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/src/composer-normalize.php b/src/composer-normalize.php index de592b9..d6a3750 100644 --- a/src/composer-normalize.php +++ b/src/composer-normalize.php @@ -153,6 +153,13 @@ public function createFor(TaskReportInterface $report): OutputTransformerInterfa private const REGEX_SCHEMA_VIOLATION = '#^.* does not match the expected JSON schema:$#'; private const REGEX_SKIPPED_COMMAND = '#^(?Plugin command normalize \(.*\) would' . ' override a Composer command and has been skipped)#'; + private const READING_FILE = '#^Reading.*#'; + private const LOADING_FILE = '#^Loading.*#'; + private const CHECKED_CA_OR_DIRECTORY = '#^Checked (?:CA|directory).*#'; + private const UNCONFIGURED_DOMAIN = '#^(?.* is not in the configured .*, adding it ' . + 'implicitly as authentication is configured for this domain)#'; + private const EXECUTING_COMMAND = '#^(?Executing (?:async )?command.*)#'; + private const RUNNING_VERSION_INFORMATION = '#^(?Running .* with PHP .* on .*)#'; /** @var string */ private $composerFile; @@ -164,6 +171,7 @@ public function createFor(TaskReportInterface $report): OutputTransformerInterfa private $report; /** @var list */ private $ignore; + private $inDiff = false; /** @param list $ignore */ public function __construct(string $composerFile, TaskReportInterface $report, array $ignore) @@ -176,20 +184,47 @@ public function __construct(string $composerFile, TaskReportInterface $report, a public function write(string $data, int $channel): void { + // strip ansi codes. + $ascii = preg_replace('#\[[0-9;]+m#', '', $data); + if ('' === $ascii) { + return; + } if (OutputInterface::CHANNEL_STDOUT === $channel) { // This is the ONLY line that is on output channel instead of error. - if (1 === preg_match(self::REGEX_IS_NORMALIZED, $dummy = trim($data))) { + if (1 === preg_match(self::REGEX_IS_NORMALIZED, $dummy = trim($ascii))) { $this->logDiagnostic( $this->composerFile . ' is normalized.', TaskReportInterface::SEVERITY_INFO ); return; } - $this->diff .= $data; + // Chop off beginning. + if (false !== ($start = \strpos($ascii, "---------- begin diff ----------\n"))) { + $ascii = substr($ascii, $start + 33); + $this->inDiff = true; + } + if (!$this->inDiff) { + return; + } + // Translate file name in diff. + $ascii = str_replace('--- original', '--- ' . $this->composerFile, $ascii); + $ascii = str_replace('+++ normalized', '+++ ' . $this->composerFile, $ascii); + + // Chop off trailing. + if (false !== ($end = \strpos($ascii, "----------- end diff -----------\n"))) { + $this->diff .= substr($ascii, 0, $end - 1); + $this->inDiff = false; + } + // Add content. + if ($this->inDiff) { + $this->diff = $ascii; + return; + } + return; } - $this->data->push($data); + $this->data->push($ascii); } public function finish(int $exitCode): void @@ -203,6 +238,7 @@ public function finish(int $exitCode): void /** @psalm-param TSeverity $severity */ private function logDiagnostic(string $message, string $severity): void { + /** @psalm-trace $severity */ $this->report->addDiagnostic($severity, $message)->forFile($this->composerFile)->end()->end(); } @@ -304,6 +340,24 @@ private function processLine(string $line): bool self::REGEX_SKIPPED_COMMAND => function (string $message): void { $this->logDiagnostic($message, TaskReportInterface::SEVERITY_INFO); }, + self::READING_FILE => function (): void { + // Ignore. + }, + self::LOADING_FILE => function (): void { + // Ignore. + }, + self::CHECKED_CA_OR_DIRECTORY => function (): void { + // Ignore. + }, + self::UNCONFIGURED_DOMAIN => function (string $message): void { + $this->logDiagnostic($message, TaskReportInterface::SEVERITY_INFO); + }, + self::EXECUTING_COMMAND => function (string $message): void { + $this->logDiagnostic($message, TaskReportInterface::SEVERITY_INFO); + }, + self::RUNNING_VERSION_INFORMATION => function (string $message): void { + $this->logDiagnostic($message, TaskReportInterface::SEVERITY_INFO); + }, ] as $pattern => $handler ) { if (1 === preg_match($pattern, $line, $matches)) { From 419835e0dbf1092159e9cd9682989280f86a4900 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 18:41:25 +0200 Subject: [PATCH 3/9] Bump plugin api --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 4377063..a6e0e8b 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/phpcq/plugin-api.git", - "reference": "afc5a467fcca3d4ac1bc39587b7b9f0a4e45a3ab" + "reference": "5cdbbbcea41191533e8c2bee4a61a73d731df0bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpcq/plugin-api/zipball/afc5a467fcca3d4ac1bc39587b7b9f0a4e45a3ab", - "reference": "afc5a467fcca3d4ac1bc39587b7b9f0a4e45a3ab", + "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": "2022-01-13T10:56:37+00:00" + "time": "2024-03-21T08:35:42+00:00" } ], "packages-dev": [ @@ -209,5 +209,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } From f766bcbeb3d12e5ff5ae0cfa96b9f78ecf2a8ce8 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 19:18:01 +0200 Subject: [PATCH 4/9] Expand github actions --- .github/workflows/diagnostics.yml | 36 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index e5edebd..e70a8b2 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -10,22 +10,36 @@ jobs: build: runs-on: ubuntu-latest - name: PHP ${{ matrix.php }} + name: PHP ${{ matrix.php }} - composer ${{ matrix.composer_install }} strategy: fail-fast: false matrix: include: - - php: 7.4 - output: '-o github-action -o default' + - php: '7.4' phpcq_install: 'install' - - php: 8.0 - output: '-o default' + phpcq_flags: '' + composer_install: 'update --prefer-lowest' + - php: '8.1' phpcq_install: 'update' + phpcq_flags: '' + composer_install: 'update' + - php: '8.1' + phpcq_install: 'update' + phpcq_flags: '' + composer_install: 'update' + - php: '8.2' + phpcq_install: 'update' + phpcq_flags: '' + composer_install: 'update' + - php: '8.3' + phpcq_install: 'update' + phpcq_flags: '' + composer_install: 'update' steps: - name: Pull source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 @@ -33,9 +47,9 @@ 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 }} + cache-name: composer-cache-dir-${{ matrix.php }}-${{ matrix.composer_install }} with: path: ~/.cache/composer key: ${{ runner.os }}-build-${{ env.cache-name }} @@ -44,7 +58,7 @@ jobs: run: composer install - name: Cache vendor directory - uses: actions/cache@v1 + uses: actions/cache@v4 env: cache-name: vendor-${{ matrix.php }} with: @@ -57,7 +71,7 @@ jobs: run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v - name: Cache phpcq directory - uses: actions/cache@v1 + uses: actions/cache@v4 env: cache-name: phpcq-${{ matrix.php }} with: @@ -70,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@v4 if: ${{ success() }} || ${{ failure() }} with: name: phpcq-builds-php-${{ matrix.php }} From e7dfc585134636bf1db2793468697e3c29a597fd Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 19:47:54 +0200 Subject: [PATCH 5/9] Bump tools for PHP 7.4 --- .phpcq.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.phpcq.lock b/.phpcq.lock index ab63dc0..0a5d6d6 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.13","url":"https://phar.phpunit.de/phpunit-9.5.13.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"16742686383afac8a7a1e3f905862d77169746b0342f66ab80b0148582e5472a"},"signature":"https://phar.phpunit.de/phpunit-9.5.13.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":"4.19.0","url":"https://github.com/vimeo/psalm/releases/download/4.19.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/4.19.0/psalm.phar.asc"}}},"composer-require-checker":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-require-checker-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8"}},"checksum":{"type":"sha-512","value":"5b0fd8cd5e0f5761c53b9d5375b6f6ba50f148468896248f823cc2a48361adfd872556066764b1b544ff51ffd5de60d6f9a75050db00b257d807976ac761bc3a"},"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.1","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.1/composer-normalize.phar","requirements":{"php":{"php":"^7.4 || ^8.0"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.1/composer-normalize.phar.asc"}}}},"tools":[]} \ No newline at end of file +{"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":"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"}},"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.2","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.9.2/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.2/phpcs.phar.asc"},"phpcbf":{"version":"3.9.2","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.9.2/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.2/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 From 8532d7db45c40bf595e06ef1b9ecb83d5beebc94 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 20:05:25 +0200 Subject: [PATCH 6/9] Fix artifacts name to prevent collision --- .github/workflows/diagnostics.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index e70a8b2..2151e98 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -87,5 +87,5 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ success() }} || ${{ failure() }} with: - name: phpcq-builds-php-${{ matrix.php }} + name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.phpcq_install }}-${{ matrix.phpcq_flags }}-${{ matrix.composer_install }} path: .phpcq/build/ From 2ee052e61322d686a547bee76bc8716553f1ab6a Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 20:46:10 +0200 Subject: [PATCH 7/9] Re-add php 8.0 --- .github/workflows/diagnostics.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index 2151e98..0bae566 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -20,7 +20,11 @@ jobs: phpcq_install: 'install' phpcq_flags: '' composer_install: 'update --prefer-lowest' - - php: '8.1' + - php: '8.0' + phpcq_install: 'update' + phpcq_flags: '' + composer_install: 'update --prefer-lowest' + - php: '8.0' phpcq_install: 'update' phpcq_flags: '' composer_install: 'update' From 00023fb6cf740a07f51b4c8be4081e28e26309e7 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Wed, 24 Apr 2024 20:56:37 +0200 Subject: [PATCH 8/9] Restore output --- .github/workflows/diagnostics.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index 0bae566..f7b31f1 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -20,26 +20,32 @@ jobs: phpcq_install: 'install' phpcq_flags: '' composer_install: 'update --prefer-lowest' + output: '-o github-action -o default' - php: '8.0' phpcq_install: 'update' phpcq_flags: '' composer_install: 'update --prefer-lowest' + output: '-o github-action -o default' - php: '8.0' phpcq_install: 'update' phpcq_flags: '' composer_install: 'update' + output: '-o github-action -o default' - php: '8.1' phpcq_install: 'update' phpcq_flags: '' composer_install: 'update' + output: '-o github-action -o default' - php: '8.2' phpcq_install: 'update' phpcq_flags: '' composer_install: 'update' + output: '-o github-action -o default' - php: '8.3' phpcq_install: 'update' phpcq_flags: '' composer_install: 'update' + output: '-o github-action -o default' steps: - name: Pull source From 594801593c6a1f4c30e4c3c04d306b1c50df6102 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Mon, 29 Apr 2024 11:26:05 +0200 Subject: [PATCH 9/9] Add static to functions where possible --- src/composer-normalize.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/composer-normalize.php b/src/composer-normalize.php index d6a3750..51f9654 100644 --- a/src/composer-normalize.php +++ b/src/composer-normalize.php @@ -281,7 +281,7 @@ private function processLine(string $line): bool foreach ( // Regex => callback (...): void [ - self::REGEX_IN_APPLICATION => function (): void { + self::REGEX_IN_APPLICATION => static function (): void { // Ignore header. }, self::REGEX_NOT_WRITABLE => function (): void { @@ -340,13 +340,13 @@ private function processLine(string $line): bool self::REGEX_SKIPPED_COMMAND => function (string $message): void { $this->logDiagnostic($message, TaskReportInterface::SEVERITY_INFO); }, - self::READING_FILE => function (): void { + self::READING_FILE => static function (): void { // Ignore. }, - self::LOADING_FILE => function (): void { + self::LOADING_FILE => static function (): void { // Ignore. }, - self::CHECKED_CA_OR_DIRECTORY => function (): void { + self::CHECKED_CA_OR_DIRECTORY => static function (): void { // Ignore. }, self::UNCONFIGURED_DOMAIN => function (string $message): void {