Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | final class LocaleProvider |
||
20 | { |
||
21 | /** |
||
22 | * @var LocaleResolver[] |
||
23 | */ |
||
24 | private readonly array $resolvers; |
||
25 | |||
26 | private string $locale; |
||
27 | |||
28 | /** |
||
29 | * @param string[] $allowed |
||
30 | * @api |
||
31 | */ |
||
32 | public function __construct( |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @api |
||
41 | */ |
||
42 | public function resolve(): string |
||
43 | { |
||
44 | /** @psalm-suppress RedundantPropertyInitializationCheck */ |
||
45 | return $this->locale ??= $this->getLocale(); |
||
46 | } |
||
47 | |||
48 | private function getLocale(): string |
||
58 | } |
||
59 | } |
||
60 |