Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 77.78% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class LocaleState implements Stringable |
||
13 | { |
||
14 | 130 | public function __construct( |
|
15 | private string $locale = 'en' |
||
16 | ) { |
||
17 | 130 | } |
|
18 | |||
19 | /** |
||
20 | * Set the specified locale code. |
||
21 | * |
||
22 | * @param string $locale The locale code. |
||
23 | */ |
||
24 | 3 | public function setLocale(string $locale): self |
|
25 | { |
||
26 | 3 | $this->locale = $locale; |
|
27 | 3 | return $this; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * Gets the locale code. |
||
32 | * |
||
33 | * @return string The locale code. |
||
34 | */ |
||
35 | 66 | public function getLocale(): string |
|
36 | { |
||
37 | 66 | return $this->locale; |
|
38 | } |
||
39 | |||
40 | public function __toString(): string |
||
43 | } |
||
44 | } |
||
45 |