/** * @Transform :localeName */ public function castToLocaleName($localeCode) { try { return $this->localeNameConverter->convertCodeToName($localeCode); } catch (\InvalidArgumentException $exception) { return $localeCode; } }
function it_converts_locales_code_to_name(LocaleConverterInterface $localeConverter) { $localeConverter->convertCodeToName('fr_FR')->willReturn('French (France)'); $this->convertCodeToName('fr_FR')->shouldReturn('French (France)'); }
/** * {@inheritdoc} */ public function convertCodeToName($localeCode) { return $this->localeConverter->convertCodeToName($localeCode); }