diff --git a/.travis.yml b/.travis.yml index 7c9388b..c33efb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ dist: trusty sudo: false php: - - 7.1 + - 7.3.5 cache: directories: @@ -23,4 +23,4 @@ script: - export SYMFONY_PHPUNIT_VERSION=5.7.1 - export SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - export SYMFONY_DEPRECATIONS_HELPER=strict - - vendor/phpunit/phpunit/phpunit --verbose \ No newline at end of file + - vendor/phpunit/phpunit/phpunit --verbose diff --git a/composer.json b/composer.json index 8c029d7..95b2247 100644 --- a/composer.json +++ b/composer.json @@ -9,12 +9,12 @@ } ], "require": { - "php": "^7.1", + "php": "^7.2.5", "api-platform/core": "^2.1", "doctrine/orm": "^2.4.5", - "doctrine/doctrine-bundle": "^1.6", - "symfony/translation": "^4.2", - "symfony/dependency-injection": "^3.4" + "doctrine/doctrine-bundle": "^1.6 || ^2.0", + "symfony/translation": "*", + "symfony/dependency-injection": "*" }, "require-dev": { "phpunit/phpunit": "^7.3" diff --git a/src/Translation/Translator.php b/src/Translation/Translator.php index 574060f..cc3df89 100644 --- a/src/Translation/Translator.php +++ b/src/Translation/Translator.php @@ -5,7 +5,7 @@ namespace Locastic\ApiPlatformTranslationBundle\Translation; use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorInterface; /** * Class Translator @@ -55,18 +55,6 @@ public function trans($id, array $parameters = array(), $domain = null, $locale return $this->translator->trans($id, $parameters, $domain, $locale); } - /** - * {@inheritdoc} - */ - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null): string - { - if (!$locale) { - $locale = $this->loadCurrentLocale(); - } - - return $this->translator->transChoice($id, $number, $parameters, $domain, $locale); - } - /** * @return string */ diff --git a/tests/EventListener/AssignLocaleListenerTest.php b/tests/EventListener/AssignLocaleListenerTest.php index 2675dc6..790057e 100644 --- a/tests/EventListener/AssignLocaleListenerTest.php +++ b/tests/EventListener/AssignLocaleListenerTest.php @@ -106,7 +106,7 @@ private function loadCurrentLocale() /** * {@inheritdoc} */ - protected function setUp() + protected function setUp(): void { $this->translator = $this->createMock(Translator::class); $this->defaultLocale = 'en'; diff --git a/tests/Translation/TranslatorTest.php b/tests/Translation/TranslatorTest.php index 2b51352..d04eee6 100644 --- a/tests/Translation/TranslatorTest.php +++ b/tests/Translation/TranslatorTest.php @@ -9,7 +9,7 @@ use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorInterface; /** * Class TranslatorTest @@ -37,7 +37,7 @@ class TranslatorTest extends TestCase /** * {@inheritdoc} */ - protected function setUp() + protected function setUp(): void { $this->defaultLocale = 'en'; $this->translator = $this->createMock(TranslatorInterface::class);