Skip to content

Commit

Permalink
Merge 6d6a572 into 6ef2d34
Browse files Browse the repository at this point in the history
  • Loading branch information
jorrit committed Jun 16, 2020
2 parents 6ef2d34 + 6d6a572 commit 69ee04c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 35 deletions.
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@
],
"require": {
"php": "^7.1",
"symfony/config": "^4.4",
"symfony/dependency-injection": "^4.4",
"symfony/http-foundation": "^4.4",
"symfony/http-kernel": "^4.4",
"symfony/intl": "^4.4",
"symfony/templating": "^4.4",
"symfony/config": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/http-foundation": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/intl": "^4.4 || ^5.0",
"symfony/templating": "^4.4 || ^5.0",
"twig/twig": "^2.9"
},
"conflict": {
"sonata-project/user-bundle": "<2.0 || >=5.0"
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"sonata-project/user-bundle": "^3.6 || ^4.0",
"symfony/phpunit-bridge": "^5.1",
"symfony/security-core": "^4.4"
"symfony/security-core": "^4.4 || ^5.0"
},
"config": {
"sort-packages": true
Expand Down
27 changes: 0 additions & 27 deletions src/Templating/Helper/LocaleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ class LocaleHelper extends BaseHelper
*/
public function country($code, $locale = null)
{
// NEXT_MAJOR: Remove this when dropping < 4.3 Symfony support
if (!class_exists(Countries::class)) {
$name = Intl::getRegionBundle()->getCountryName($code, $locale ?: $this->localeDetector->getLocale());

return $name ? $this->fixCharset($name) : '';
}

return $this->fixCharset(Countries::getName($code, $locale ?: $this->localeDetector->getLocale()));
}

Expand All @@ -51,19 +44,6 @@ public function country($code, $locale = null)
*/
public function language($code, $locale = null)
{
// NEXT_MAJOR: Remove this when dropping < 4.3 Symfony support
if (!class_exists(Languages::class)) {
$codes = explode('_', $code);

$name = Intl::getLanguageBundle()->getLanguageName(
$codes[0],
$codes[1] ?? null,
$locale ?: $this->localeDetector->getLocale()
);

return $name ? $this->fixCharset($name) : '';
}

return $this->fixCharset(Languages::getName($code, $locale ?: $this->localeDetector->getLocale()));
}

Expand All @@ -75,13 +55,6 @@ public function language($code, $locale = null)
*/
public function locale($code, $locale = null)
{
// NEXT_MAJOR: Remove this when dropping < 4.3 Symfony support
if (!class_exists(Locales::class)) {
$name = Intl::getLocaleBundle()->getLocaleName($code, $locale ?: $this->localeDetector->getLocale());

return $name ? $this->fixCharset($name) : '';
}

return $this->fixCharset(Locales::getName($code, $locale ?: $this->localeDetector->getLocale()));
}

Expand Down

0 comments on commit 69ee04c

Please sign in to comment.