Skip to content

Commit

Permalink
Merge pull request #582 from deguif/fix-wrong-contracts
Browse files Browse the repository at this point in the history
Fix wrong return type-hint depending on which symfony/translation version is installed
  • Loading branch information
goetas authored Dec 12, 2023
2 parents 6a3f801 + 2954a9d commit da38bd0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ jobs:
symfony-version:
- '^4.4'
- '^5.4'
- '^6.0'
- '^6.4'
php-version:
- "7.4"
- "8.0"
- "8.1"
dependencies:
- "lowest"
- "highest"
exclude:
- symfony-version: '^6.4'
php-version: '7.4'
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand Down
4 changes: 2 additions & 2 deletions Translation/Loader/Symfony/XliffLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit da38bd0

Please sign in to comment.