| 1 | <?php |
||
| 14 | final class Country |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $code; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $name; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Country constructor. |
||
| 28 | * |
||
| 29 | * @param string $code |
||
| 30 | * @param string $name |
||
| 31 | */ |
||
| 32 | public function __construct(string $code, string $name) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | public function getCode(): string |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public function getName(): string |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @param array $data |
||
| 56 | * |
||
| 57 | * @return Country |
||
| 58 | */ |
||
| 59 | public static function fromApi(array $data): self |
||
| 66 | } |
||
| 67 |