Skip to content

Commit c5a79c6

Browse files
authored
Add PHP 8.4 to CI (#167)
1 parent 479752c commit c5a79c6

File tree

11 files changed

+29
-10
lines changed

11 files changed

+29
-10
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
os: >-
3030
['ubuntu-latest', 'windows-latest']
3131
php: >-
32-
['8.1', '8.2', '8.3']
32+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/composer-require-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
os: >-
3232
['ubuntu-latest']
3333
php: >-
34-
['8.1', '8.2', '8.3']
34+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/mutation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ jobs:
2727
os: >-
2828
['ubuntu-latest']
2929
php: >-
30-
['8.2']
30+
['8.4']
3131
secrets:
3232
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
os: >-
2222
['ubuntu-latest']
2323
php: >-
24-
['8.3']
24+
['8.4']

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
os: >-
3030
['ubuntu-latest']
3131
php: >-
32-
['8.1', '8.2', '8.3']
32+
['8.1', '8.2', '8.3', '8.4']

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Enh #165: Raise the minimum PHP version to 8.1 (@vjik)
99
- Bug #166: `ArrayHelper::getValue()` returns default value on empty array key (@vjik)
1010
- Bug #166: `ArrayHelper::keyExists()` returns false on empty array key (@vjik)
11+
- Chg #167: Change PHP constraint in `composer.json` to `~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik)
1112

1213
## 3.1.0 April 04, 2024
1314

composer.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
}
2929
],
3030
"require": {
31-
"php": "^8.1",
31+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
3232
"yiisoft/strings": "^2.1"
3333
},
3434
"require-dev": {
35-
"maglnet/composer-require-checker": "^4.7.1",
35+
"bamarni/composer-bin-plugin": "^1.8.2",
3636
"phpunit/phpunit": "^10.5.43",
3737
"rector/rector": "^2.0.7",
3838
"roave/infection-static-analysis-plugin": "^1.35",
3939
"spatie/phpunit-watcher": "^1.24",
40-
"vimeo/psalm": "^5.26.1"
40+
"vimeo/psalm": "^5.26.1|^6.1"
4141
},
4242
"autoload": {
4343
"psr-4": {
@@ -53,10 +53,18 @@
5353
"sort-packages": true,
5454
"bump-after-update": "dev",
5555
"allow-plugins": {
56+
"bamarni/composer-bin-plugin": true,
5657
"infection/extension-installer": true,
5758
"composer/package-versions-deprecated": true
5859
}
5960
},
61+
"extra": {
62+
"bamarni-bin": {
63+
"bin-links": true,
64+
"target-directory": "tools",
65+
"forward-command": true
66+
}
67+
},
6068
"scripts": {
6169
"test": "phpunit --testdox --no-interaction",
6270
"test-watch": "phpunit-watcher watch"

src/ArrayHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ public static function getValue(
217217
if (empty($key)) {
218218
return $default;
219219
}
220-
/** @psalm-var array<mixed,string|int> $key */
221220
$lastKey = array_pop($key);
222221
foreach ($key as $keyPart) {
223222
$array = self::getRootValue($array, $keyPart, null);
@@ -951,6 +950,8 @@ public static function keyExists(array $array, array|float|int|string $key, bool
951950
return self::rootKeyExists($array, end($key), $caseSensitive);
952951
}
953952

953+
/** @psalm-var non-empty-array<array-key,float|int|string> $key */
954+
954955
foreach (self::getExistsKeys($array, array_shift($key), $caseSensitive) as $existKey) {
955956
$array = self::getRootValue($array, $existKey, null);
956957
if (is_array($array) && self::keyExists($array, $key, $caseSensitive)) {

tests/ArrayHelper/GetValueTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Yiisoft\Arrays\Tests\ArrayHelper;
66

77
use ArrayObject;
8-
use Error;
98
use InvalidArgumentException;
109
use PHPUnit\Framework\Attributes\DataProvider;
1110
use PHPUnit\Framework\TestCase;

tools/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*/vendor
2+
/*/composer.lock

0 commit comments

Comments
 (0)