diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3feaeef..54dfa76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,4 +29,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.1', '8.2', '8.3'] + ['8.1', '8.2', '8.3', '8.4'] diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index a857bce..a93390b 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1', '8.2', '8.3'] + ['8.1', '8.2', '8.3', '8.4'] diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 8150499..a56769e 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -27,6 +27,6 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.2'] + ['8.4'] secrets: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 35411d0..b229445 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -20,4 +20,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.3'] + ['8.4'] diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index dc6368a..686f9bd 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -33,8 +33,8 @@ jobs: psalm83: uses: yiisoft/actions/.github/workflows/psalm.yml@master with: - psalm-config: psalm83.xml + psalm-config: psalm83-84.xml os: >- ['ubuntu-latest'] php: >- - ['8.3'] + ['8.3', '8.4'] diff --git a/CHANGELOG.md b/CHANGELOG.md index d8cd049..1dda97f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Enh #175: Minor refactoring of internal classes `Options` and `ProcessHelper` (@vjik) - Bug #186: Explicitly mark nullable parameters (@vjik) - Enh #186: Raise the minimum PHP version to 8.1 and minor refactoring (@vjik) +- Chg #187: Change PHP constraint in `composer.json` to `~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik) ## 1.5.0 December 25, 2023 diff --git a/composer.json b/composer.json index b7ffe55..75e4c9b 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ } ], "require": { - "php": "^8.1", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "composer-plugin-api": "^2.0", "symfony/console": "^5.4.11|^6.0.11|^7", "yiisoft/arrays": "^3.0", @@ -36,13 +36,13 @@ "yiisoft/var-dumper": "^1.1" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", "composer/composer": "^2.8.5", - "maglnet/composer-require-checker": "^4.7.1", - "phpunit/phpunit": "^10.5.43", + "phpunit/phpunit": "^10.5.44", "rector/rector": "^2.0.7", "roave/infection-static-analysis-plugin": "^1.35", "spatie/phpunit-watcher": "^1.24", - "vimeo/psalm": "^5.26.1" + "vimeo/psalm": "^5.26.1|^6.1" }, "suggest": { "symfony/console": "To use composer commands `yii-config-copy` and `yii-config-rebuild`." @@ -51,8 +51,9 @@ "sort-packages": true, "bump-after-update": "dev", "allow-plugins": { - "infection/extension-installer": true, - "composer/package-versions-deprecated": true + "bamarni/composer-bin-plugin": true, + "composer/package-versions-deprecated": true, + "infection/extension-installer": true } }, "autoload": { @@ -66,7 +67,12 @@ } }, "extra": { - "class": "Yiisoft\\Config\\Composer\\EventHandler" + "class": "Yiisoft\\Config\\Composer\\EventHandler", + "bamarni-bin": { + "bin-links": true, + "target-directory": "tools", + "forward-command": true + } }, "scripts": { "test": "phpunit --testdox --no-interaction", diff --git a/psalm83.xml b/psalm83-84.xml similarity index 100% rename from psalm83.xml rename to psalm83-84.xml diff --git a/src/Composer/ConfigSettings.php b/src/Composer/ConfigSettings.php index ebc4b12..e7de2cf 100644 --- a/src/Composer/ConfigSettings.php +++ b/src/Composer/ConfigSettings.php @@ -52,6 +52,7 @@ private function __construct( public static function forRootPackage(Composer $composer): self { + /** @psalm-suppress PossiblyFalseArgument */ return new self( realpath(dirname(Factory::getComposerFile())), $composer->getPackage()->getExtra(), diff --git a/src/Composer/MergePlanProcess.php b/src/Composer/MergePlanProcess.php index 98b62bc..0e35695 100644 --- a/src/Composer/MergePlanProcess.php +++ b/src/Composer/MergePlanProcess.php @@ -150,6 +150,7 @@ private function updateMergePlan(): void ); (new Filesystem())->ensureDirectoryExists(dirname($filePath)); + /** @var string $oldContent */ $oldContent = is_file($filePath) ? file_get_contents($filePath) : ''; $content = 'paths->absolute($item, $package); + /** @psalm-var list $files */ $files = Options::containsWildcard($item) ? glob($filePath) : [$filePath]; foreach ($files as $file) { diff --git a/src/Modifier/RemoveKeysFromVendor.php b/src/Modifier/RemoveKeysFromVendor.php index a4e805c..76fec43 100644 --- a/src/Modifier/RemoveKeysFromVendor.php +++ b/src/Modifier/RemoveKeysFromVendor.php @@ -18,6 +18,7 @@ final class RemoveKeysFromVendor /** * @var string[][] + * @psalm-var list> */ private array $packages = []; @@ -48,6 +49,7 @@ public function getKeys(): array /** * @return string[][] + * @psalm-return list> */ public function getPackages(): array { diff --git a/tests/Integration/BrokenFile/BrokenFileTest.php b/tests/Integration/BrokenFile/BrokenFileTest.php index ff38760..bb3ee69 100644 --- a/tests/Integration/BrokenFile/BrokenFileTest.php +++ b/tests/Integration/BrokenFile/BrokenFileTest.php @@ -9,6 +9,9 @@ final class BrokenFileTest extends IntegrationTestCase { + /** + * @requires PHP < 8.4 + */ public function testBase(): void { $config = $this->runComposerUpdateAndCreateConfig( diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000..cf452dc --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,2 @@ +/*/vendor +/*/composer.lock diff --git a/tools/composer-require-checker/composer.json b/tools/composer-require-checker/composer.json new file mode 100644 index 0000000..35b552f --- /dev/null +++ b/tools/composer-require-checker/composer.json @@ -0,0 +1,8 @@ +{ + "require-dev": { + "maglnet/composer-require-checker": "^4.7.1" + }, + "config": { + "bump-after-update": "dev" + } +}