Skip to content

Commit

Permalink
Add PHP 8.4 to CI (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Feb 3, 2025
1 parent fee652e commit 8978c6f
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
2 changes: 1 addition & 1 deletion .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2', '8.3']
['8.1', '8.2', '8.3', '8.4']
2 changes: 1 addition & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.2']
['8.4']
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.3']
['8.4']
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 13 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
}
],
"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",
"yiisoft/strings": "^2.0",
"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`."
Expand All @@ -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": {
Expand All @@ -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",
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/Composer/ConfigSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 1 addition & 0 deletions src/Composer/MergePlanProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<?php'
Expand Down
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private function buildFile(string $filePath): array
throw new ErrorException($errorString, $errorNumber, 0, $errorFile, $errorLine);
});

/** @psalm-suppress MixedArgument */
/** @psalm-suppress MixedArgument, PossiblyFalseArgument */
extract(func_get_arg(1), EXTR_SKIP);

/**
Expand Down
1 change: 1 addition & 0 deletions src/FilesExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ private function process(string $environment, string $group, array $data): array
}

$filePath = $this->paths->absolute($item, $package);
/** @psalm-var list<string> $files */
$files = Options::containsWildcard($item) ? glob($filePath) : [$filePath];

foreach ($files as $file) {
Expand Down
2 changes: 2 additions & 0 deletions src/Modifier/RemoveKeysFromVendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ final class RemoveKeysFromVendor

/**
* @var string[][]
* @psalm-var list<non-empty-array<string>>
*/
private array $packages = [];

Expand Down Expand Up @@ -48,6 +49,7 @@ public function getKeys(): array

/**
* @return string[][]
* @psalm-return list<non-empty-array<string>>
*/
public function getPackages(): array
{
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/BrokenFile/BrokenFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

final class BrokenFileTest extends IntegrationTestCase
{
/**
* @requires PHP < 8.4
*/
public function testBase(): void
{
$config = $this->runComposerUpdateAndCreateConfig(
Expand Down
2 changes: 2 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*/vendor
/*/composer.lock
8 changes: 8 additions & 0 deletions tools/composer-require-checker/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require-dev": {
"maglnet/composer-require-checker": "^4.7.1"
},
"config": {
"bump-after-update": "dev"
}
}

0 comments on commit 8978c6f

Please sign in to comment.