Skip to content

Commit 821601c

Browse files
authored
PHP 8.4 support (#151)
1 parent 6a8882b commit 821601c

File tree

10 files changed

+23
-15
lines changed

10 files changed

+23
-15
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
os: >-
3434
['ubuntu-latest', 'windows-latest']
3535
php: >-
36-
['8.0', '8.1', '8.2', '8.3']
36+
['8.0', '8.1', '8.2', '8.3', '8.4']
3737
phpunit-with-intl:
3838
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
3939
secrets:
@@ -45,4 +45,4 @@ jobs:
4545
os: >-
4646
['ubuntu-latest', 'windows-latest']
4747
php: >-
48-
['8.0', '8.1', '8.2', '8.3']
48+
['8.0', '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/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
@@ -30,7 +30,7 @@ jobs:
3030
os: >-
3131
['ubuntu-latest']
3232
php: >-
33-
['8.1', '8.2', '8.3']
33+
['8.1', '8.2', '8.3', '8.4']
3434
psalm80:
3535
uses: yiisoft/actions/.github/workflows/psalm.yml@master
3636
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 3.1.1 under development
44

55
- New #149: Add `InMemoryMessageSource` (@vjik)
6+
- Chg #150: Change PHP constraint in `composer.json` to `8.0 - 8.4` (@vjik)
67

78
## 3.1.0 December 26, 2024
89

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
}
2929
],
3030
"require": {
31-
"php": "^8.0",
31+
"php": "8.0 - 8.4",
3232
"psr/event-dispatcher": "1.0.0",
33-
"yiisoft/files": "^1.0|^2.0",
33+
"yiisoft/files": "^1.0 || ^2.0",
3434
"yiisoft/i18n": "^1.0"
3535
},
3636
"require-dev": {
37-
"maglnet/composer-require-checker": "^4.2",
38-
"phpunit/phpunit": "^9.6",
39-
"rector/rector": "^2.0.3",
37+
"maglnet/composer-require-checker": "^4.4",
38+
"phpunit/phpunit": "^9.6.22",
39+
"rector/rector": "^2.0.10",
4040
"roave/infection-static-analysis-plugin": "^1.25",
41-
"spatie/phpunit-watcher": "^1.23",
42-
"vimeo/psalm": "^4.30|^5.21",
43-
"yiisoft/di": "^1.2"
41+
"spatie/phpunit-watcher": "^1.23.6",
42+
"vimeo/psalm": "^4.30 || ^5.26.1 || ^6.8.9",
43+
"yiisoft/di": "^1.2.1"
4444
},
4545
"suggest": {
4646
"ext-intl": "Allows using intl message formatter",

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
errorLevel="1"
44
findUnusedBaselineEntry="true"
55
findUnusedCode="false"
6+
ensureOverrideAttribute="false"
67
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
78
xmlns="https://getpsalm.org/schema/config"
89
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

src/Extractor/TranslationExtractor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public function extract(string $defaultCategory = 'app', ?string $translatorCall
7777
]);
7878

7979
foreach ($files as $file) {
80+
/**
81+
* @var string $fileContent We assume that `file_get_contents` can always read the file.
82+
*/
8083
$fileContent = file_get_contents($file);
8184
$messages = array_merge_recursive($messages, $parser->extract($fileContent));
8285
if ($parser->hasSkippedLines()) {

src/SimpleMessageFormatter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use function in_array;
1111
use function is_int;
1212

13+
/**
14+
* @final
15+
*/
1316
class SimpleMessageFormatter implements MessageFormatterInterface
1417
{
1518
/**

src/Translator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ final class Translator implements TranslatorInterface
2020

2121
/**
2222
* @var array Array of category message sources indexed by category names.
23-
* @psalm-var array<string,CategorySource[]>
23+
* @psalm-var array<string, non-empty-list<CategorySource>>
2424
*/
2525
private array $categorySources = [];
2626

2727
/**
28-
* @psalm-var array<string,true>
28+
* @psalm-var array<string, true>
2929
*/
3030
private array $dispatchedMissingTranslationCategoryEvents = [];
3131

0 commit comments

Comments
 (0)