From b0af442e580c9fabc38efee2321ddd3e98cbc020 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 17 Jun 2026 12:33:25 +0200 Subject: [PATCH 1/3] Fix ArrayGenerator::generateString() with includeEmpty === true --- src/Generator/ArrayGenerator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Generator/ArrayGenerator.php b/src/Generator/ArrayGenerator.php index 60dfe9f..49843ce 100644 --- a/src/Generator/ArrayGenerator.php +++ b/src/Generator/ArrayGenerator.php @@ -76,8 +76,10 @@ public function generateArray(Translations $translations): array if (self::hasPluralTranslations($translation)) { $messages[$context][$original] = $translation->getPluralTranslations($pluralSize); array_unshift($messages[$context][$original], $translation->getTranslation()); + } elseif ($pluralSize !== null && $pluralSize > 1 && (string) $translation->getPlural() !== '') { + $messages[$context][$original] = array_fill(0, $pluralSize, ''); } else { - $messages[$context][$original] = $translation->getTranslation(); + $messages[$context][$original] = (string) $translation->getTranslation(); } } From 16dc45bf5272c5c86c88433d5ff72f3b6a4575e1 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 17 Jun 2026 13:46:35 +0200 Subject: [PATCH 2/3] Fix tests --- tests/ArrayGeneratorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ArrayGeneratorTest.php b/tests/ArrayGeneratorTest.php index b41d42c..a071a88 100644 --- a/tests/ArrayGeneratorTest.php +++ b/tests/ArrayGeneratorTest.php @@ -66,7 +66,7 @@ public function testArrayGeneratorWithEmptyTranslations() 'messages' => [ '' => [ 'Empty translation included' => '', - 'Inexistent translation included' => null, + 'Inexistent translation included' => '', ], ], ]; From b6bced08f1cf781f6524ad3d9d2843a6cef784e4 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 17 Jun 2026 13:48:39 +0200 Subject: [PATCH 3/3] Test against PHP 8.5 too, update GH Action versions --- .github/workflows/test.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 56841fd..9ced80c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,19 +14,20 @@ jobs: strategy: matrix: php: - - 7.2 - - 7.3 - - 7.4 - - 8.0 - - 8.1 - - 8.2 - - 8.3 - - 8.4 + - "7.2" + - "7.3" + - "7.4" + - "8.0" + - "8.1" + - "8.2" + - "8.3" + - "8.4" + - "8.5" fail-fast: false steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -34,7 +35,7 @@ jobs: php-version: ${{ matrix.php }} - name: Cache PHP dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: vendor key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}