From 85387ae61766f2a2dc3fd22038ac5cc8606a349a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 26 Sep 2023 20:44:27 +0200 Subject: [PATCH 1/2] Allow installation on PHP 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Cobucci --- .github/workflows/phpunit.yml | 3 ++- composer.json | 14 +++++++------- composer.lock | 30 +++++++++++++++--------------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 2634d041..df58d7e9 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -19,6 +19,7 @@ jobs: - "development" php-version: - "8.2" + - "8.3" operating-system: - "ubuntu-latest" @@ -73,7 +74,7 @@ jobs: dependencies: - "locked" php-version: - - "8.3" + - "8.4" operating-system: - "ubuntu-latest" diff --git a/composer.json b/composer.json index ce0df2e3..f2cd93b7 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "~8.2.0", + "php": "~8.2.0 || ~8.3.0", "psr/clock": "^1.0" }, "require-dev": { @@ -23,6 +23,9 @@ "phpstan/phpstan-strict-rules": "^1.5.1", "phpunit/phpunit": "^10.2.3" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "autoload": { "psr-4": { "Lcobucci\\Clock\\": "src" @@ -34,15 +37,12 @@ } }, "config": { - "preferred-install": "dist", - "sort-packages": true, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, "infection/extension-installer": true, "phpstan/extension-installer": true - } - }, - "provide": { - "psr/clock-implementation": "1.0" + }, + "preferred-install": "dist", + "sort-packages": true } } diff --git a/composer.lock b/composer.lock index 51aafb4d..33d1713f 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": "1f207478dd6a314116c0358c5a09ce36", + "content-hash": "618833639c5faf5b307de4b2832d03a1", "packages": [ { "name": "psr/clock", @@ -1257,16 +1257,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.23.0", + "version": "1.24.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "a2b24135c35852b348894320d47b3902a94bc494" + "reference": "bcad8d995980440892759db0c32acae7c8e79442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", - "reference": "a2b24135c35852b348894320d47b3902a94bc494", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", + "reference": "bcad8d995980440892759db0c32acae7c8e79442", "shasum": "" }, "require": { @@ -1298,9 +1298,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" }, - "time": "2023-07-23T22:17:56+00:00" + "time": "2023-09-26T12:28:12+00:00" }, { "name": "phpstan/phpstan", @@ -2596,16 +2596,16 @@ }, { "name": "sebastian/exporter", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c3fa8483f9539b190f7cd4bfc4a07631dd1df344" + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c3fa8483f9539b190f7cd4bfc4a07631dd1df344", - "reference": "c3fa8483f9539b190f7cd4bfc4a07631dd1df344", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", "shasum": "" }, "require": { @@ -2619,7 +2619,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2662,7 +2662,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" }, "funding": [ { @@ -2670,7 +2670,7 @@ "type": "github" } ], - "time": "2023-09-18T07:15:37+00:00" + "time": "2023-09-24T13:22:09+00:00" }, { "name": "sebastian/global-state", @@ -4295,7 +4295,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.2.0" + "php": "~8.2.0 || ~8.3.0" }, "platform-dev": [], "plugin-api-version": "2.6.0" From 0761a5e661c1867688b8f769582904cad393cda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 26 Sep 2023 20:45:03 +0200 Subject: [PATCH 2/2] Run linting jobs against composer.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Cobucci --- .github/workflows/composer-json-lint.yml | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/composer-json-lint.yml diff --git a/.github/workflows/composer-json-lint.yml b/.github/workflows/composer-json-lint.yml new file mode 100644 index 00000000..86e990df --- /dev/null +++ b/.github/workflows/composer-json-lint.yml @@ -0,0 +1,67 @@ +name: "Lint composer.json" + +on: + pull_request: + push: + +jobs: + coding-standards: + name: "Lint composer.json" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "highest" + php-version: + - "8.2" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2, composer-normalize, composer-require-checker, composer-unused + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache dependencies" + uses: "actions/cache@v3" + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress" + + - name: "Validate composer.json" + run: "composer validate --strict" + + - name: "Normalize composer.json" + run: "composer-normalize --dry-run" + + - name: "Check composer.json explicit dependencies" + run: "composer-require-checker check" + + - name: "Check composer.json unused dependencies" + run: "composer-unused"