1 | <?php |
||
5 | class Country implements \JsonSerializable |
||
6 | { |
||
7 | |||
8 | /** @var string */ |
||
9 | public $code; |
||
10 | |||
11 | /** @var string */ |
||
12 | public $name; |
||
13 | |||
14 | /** |
||
15 | * Country constructor. |
||
16 | * |
||
17 | * @param string $code |
||
18 | * @param string $name |
||
19 | */ |
||
20 | public function __construct($code, $name) |
||
25 | |||
26 | /** |
||
27 | * (PHP 5 >= 5.4.0)<br/> |
||
28 | * Specify data which should be serialized to JSON |
||
29 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
30 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
31 | * which is a value of any type other than a resource. |
||
32 | */ |
||
33 | public function jsonSerialize() |
||
40 | |||
41 | } |
||
42 |