From 85b0a914afc11075bfd038a17087c7a7f031c5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20de=20Guillebon?= Date: Mon, 11 Dec 2023 19:35:18 +0100 Subject: [PATCH 1/2] fix: fix wrong return type-hint depending on which symfony/translation version is installed --- Translation/Loader/Symfony/XliffLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Translation/Loader/Symfony/XliffLoader.php b/Translation/Loader/Symfony/XliffLoader.php index d1f6aeb7..3440a301 100644 --- a/Translation/Loader/Symfony/XliffLoader.php +++ b/Translation/Loader/Symfony/XliffLoader.php @@ -22,9 +22,9 @@ use JMS\TranslationBundle\Exception\RuntimeException; use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Translation\Loader\LoaderInterface; use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\TranslatorBagInterface; /** * XLIFF loader. @@ -66,7 +66,7 @@ protected function loadInternal($resource, $locale, $domain = 'messages') } } -$isSf6 = version_compare(Kernel::VERSION, '6.0.0') >= 0; +$isSf6 = method_exists(TranslatorBagInterface::class, 'getCatalogues'); if ($isSf6) { // phpcs:ignore From 2954a9d6cc22e8441d92c3f60c5487df763aa632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20de=20Guillebon?= Date: Tue, 12 Dec 2023 10:21:56 +0100 Subject: [PATCH 2/2] chore: bump symfony version for tests --- .github/workflows/ci.yaml | 5 ++++- composer.json | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7c9dfd7d..1ab42fed 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: symfony-version: - '^4.4' - '^5.4' - - '^6.0' + - '^6.4' php-version: - "7.4" - "8.0" @@ -28,6 +28,9 @@ jobs: dependencies: - "lowest" - "highest" + exclude: + - symfony-version: '^6.4' + php-version: '7.4' steps: - name: "Checkout" uses: "actions/checkout@v2" diff --git a/composer.json b/composer.json index 521e4cad..350dafef 100644 --- a/composer.json +++ b/composer.json @@ -38,18 +38,18 @@ "doctrine/coding-standard": "^8.2.1", "matthiasnoback/symfony-dependency-injection-test": "^4.1", "nyholm/nsa": "^1.0.1", - "symfony/phpunit-bridge": ">=5.4", + "symfony/phpunit-bridge": "^4.4 || ^5.4 || ^6.4", "sensio/framework-extra-bundle": "^6.2.4", - "symfony/asset": "^4.3 || ^5.4 || ^6.0", - "symfony/browser-kit": "^4.3 || ^5.4 || ^6.0", - "symfony/css-selector": "^4.3 || ^5.4 || ^6.0", - "symfony/filesystem": "^4.3 || ^5.4 || ^6.0", - "symfony/form": "^4.3 || ^5.4 || ^6.0", - "symfony/security-csrf": "^4.3 || ^5.4 || ^6.0", - "symfony/templating": "^4.3 || ^5.4 || ^6.0", - "symfony/property-access": "^4.3 || ^5.4 || ^6.0", - "symfony/routing": "^4.4.15 || ^5.4 || ^6.0", - "symfony/twig-bundle": "^4.3.11 || ^5.4 || ^6.0", + "symfony/asset": "^4.4 || ^5.4 || ^6.4", + "symfony/browser-kit": "^4.4 || ^5.4 || ^6.4", + "symfony/css-selector": "^4.4 || ^5.4 || ^6.4", + "symfony/filesystem": "^4.4 || ^5.4 || ^6.4", + "symfony/form": "^4.4 || ^5.4 || ^6.4", + "symfony/security-csrf": "^4.4 || ^5.4 || ^6.4", + "symfony/templating": "^4.4 || ^5.4 || ^6.4", + "symfony/property-access": "^4.4 || ^5.4 || ^6.4", + "symfony/routing": "^4.4.15 || ^5.4 || ^6.4", + "symfony/twig-bundle": "^4.4 || ^5.4 || ^6.4", "symfony/flex": "^1.19 || ^2.0" }, "config": {