Skip to content

Commit

Permalink
Remove code branches that are not relevant anymore because SF 4.3 is …
Browse files Browse the repository at this point in the history
…not supported anyway
  • Loading branch information
jorrit committed Jun 16, 2020
1 parent 0bc17e7 commit 6d6a572
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/Templating/Helper/LocaleHelper.php
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 6d6a572

Please sign in to comment.