Skip to content

Commit da38bd0

Browse files
authored
Merge pull request #582 from deguif/fix-wrong-contracts
Fix wrong return type-hint depending on which symfony/translation version is installed
2 parents 6a3f801 + 2954a9d commit da38bd0

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

.github/workflows/ci.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ jobs:
2020
symfony-version:
2121
- '^4.4'
2222
- '^5.4'
23-
- '^6.0'
23+
- '^6.4'
2424
php-version:
2525
- "7.4"
2626
- "8.0"
2727
- "8.1"
2828
dependencies:
2929
- "lowest"
3030
- "highest"
31+
exclude:
32+
- symfony-version: '^6.4'
33+
php-version: '7.4'
3134
steps:
3235
- name: "Checkout"
3336
uses: "actions/checkout@v2"

Translation/Loader/Symfony/XliffLoader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
use JMS\TranslationBundle\Exception\RuntimeException;
2424
use Symfony\Component\Config\Resource\FileResource;
25-
use Symfony\Component\HttpKernel\Kernel;
2625
use Symfony\Component\Translation\Loader\LoaderInterface;
2726
use Symfony\Component\Translation\MessageCatalogue;
27+
use Symfony\Component\Translation\TranslatorBagInterface;
2828

2929
/**
3030
* XLIFF loader.
@@ -66,7 +66,7 @@ protected function loadInternal($resource, $locale, $domain = 'messages')
6666
}
6767
}
6868

69-
$isSf6 = version_compare(Kernel::VERSION, '6.0.0') >= 0;
69+
$isSf6 = method_exists(TranslatorBagInterface::class, 'getCatalogues');
7070

7171
if ($isSf6) {
7272
// phpcs:ignore

composer.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@
3838
"doctrine/coding-standard": "^8.2.1",
3939
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
4040
"nyholm/nsa": "^1.0.1",
41-
"symfony/phpunit-bridge": ">=5.4",
41+
"symfony/phpunit-bridge": "^4.4 || ^5.4 || ^6.4",
4242
"sensio/framework-extra-bundle": "^6.2.4",
43-
"symfony/asset": "^4.3 || ^5.4 || ^6.0",
44-
"symfony/browser-kit": "^4.3 || ^5.4 || ^6.0",
45-
"symfony/css-selector": "^4.3 || ^5.4 || ^6.0",
46-
"symfony/filesystem": "^4.3 || ^5.4 || ^6.0",
47-
"symfony/form": "^4.3 || ^5.4 || ^6.0",
48-
"symfony/security-csrf": "^4.3 || ^5.4 || ^6.0",
49-
"symfony/templating": "^4.3 || ^5.4 || ^6.0",
50-
"symfony/property-access": "^4.3 || ^5.4 || ^6.0",
51-
"symfony/routing": "^4.4.15 || ^5.4 || ^6.0",
52-
"symfony/twig-bundle": "^4.3.11 || ^5.4 || ^6.0",
43+
"symfony/asset": "^4.4 || ^5.4 || ^6.4",
44+
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.4",
45+
"symfony/css-selector": "^4.4 || ^5.4 || ^6.4",
46+
"symfony/filesystem": "^4.4 || ^5.4 || ^6.4",
47+
"symfony/form": "^4.4 || ^5.4 || ^6.4",
48+
"symfony/security-csrf": "^4.4 || ^5.4 || ^6.4",
49+
"symfony/templating": "^4.4 || ^5.4 || ^6.4",
50+
"symfony/property-access": "^4.4 || ^5.4 || ^6.4",
51+
"symfony/routing": "^4.4.15 || ^5.4 || ^6.4",
52+
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.4",
5353
"symfony/flex": "^1.19 || ^2.0"
5454
},
5555
"config": {

0 commit comments

Comments
 (0)