| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | readonly class CookieLocaleResolver implements LocaleResolver |
||
| 24 | { |
||
| 25 | public function __construct( |
||
| 26 | protected string $parameterName, |
||
| 27 | protected Request $httpRequest, |
||
| 28 | protected Response $httpResponse, |
||
| 29 | ) {} |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param string[] $allowed |
||
| 33 | */ |
||
| 34 | #[\Override] |
||
| 35 | public function resolve(array $allowed): ?string |
||
| 36 | { |
||
| 37 | return $this->httpRequest->getCookie($this->parameterName); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function set(string $lang): bool |
||
| 51 | } |
||
| 52 | } |
||
| 53 | } |
||
| 54 |