1 | <?php |
||
22 | final class LocaleContext implements Context |
||
23 | { |
||
24 | /** @var LocaleConverterInterface */ |
||
25 | private $localeNameConverter; |
||
26 | |||
27 | /** @var RepositoryInterface */ |
||
28 | private $localeRepository; |
||
29 | |||
30 | public function __construct(LocaleConverterInterface $localeNameConverter, RepositoryInterface $localeRepository) |
||
35 | |||
36 | /** |
||
37 | * @Transform :language |
||
38 | * @Transform :localeCode |
||
39 | * @Transform /^"([^"]+)" locale$/ |
||
40 | * @Transform /^in the "([^"]+)" locale$/ |
||
41 | */ |
||
42 | public function castToLocaleCode(string $localeName): string |
||
46 | |||
47 | /** |
||
48 | * @Transform :localeName |
||
49 | */ |
||
50 | public function castToLocaleName(string $localeCode): string |
||
54 | |||
55 | /** |
||
56 | * @Transform :locale |
||
57 | */ |
||
58 | public function getLocaleByName(string $name): LocaleInterface |
||
70 | } |
||
71 |