1 | <?php |
||
22 | final class Country |
||
23 | { |
||
24 | /** |
||
25 | * @var string|null |
||
26 | */ |
||
27 | private $name; |
||
28 | |||
29 | /** |
||
30 | * @var string|null |
||
31 | */ |
||
32 | private $code; |
||
33 | |||
34 | /** |
||
35 | * @param string $name |
||
36 | * @param string $code |
||
37 | */ |
||
38 | 6 | public function __construct(string $name = null, string $code = null) |
|
47 | |||
48 | /** |
||
49 | * Returns the country name. |
||
50 | * |
||
51 | * @return string|null |
||
52 | */ |
||
53 | 6 | public function getName() |
|
57 | |||
58 | /** |
||
59 | * Returns the country ISO code. |
||
60 | * |
||
61 | * @return string|null |
||
62 | */ |
||
63 | 6 | public function getCode() |
|
67 | |||
68 | /** |
||
69 | * Returns a string with the country name. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function __toString(): string |
||
77 | } |
||
78 |