1 | <?php |
||
11 | final class Pair implements \JsonSerializable |
||
12 | { |
||
13 | /** |
||
14 | * @param mixed $key The pair's key |
||
15 | */ |
||
16 | public $key; |
||
17 | |||
18 | /** |
||
19 | * @param mixed $value The pair's value |
||
20 | */ |
||
21 | public $value; |
||
22 | |||
23 | /** |
||
24 | * Constructor |
||
25 | * |
||
26 | * @param mixed $key |
||
27 | * @param mixed $value |
||
28 | */ |
||
29 | 713 | public function __construct($key = null, $value = null) |
|
34 | |||
35 | /** |
||
36 | * This allows unset($pair->key) to not completely remove the property, |
||
37 | * but be set to null instead. |
||
38 | * |
||
39 | * @param mixed $name |
||
40 | * |
||
41 | * @return mixed|null |
||
42 | */ |
||
43 | 3 | public function __get($name) |
|
52 | |||
53 | /** |
||
54 | * Returns a copy of the Pair |
||
55 | * |
||
56 | * @return Pair |
||
57 | */ |
||
58 | 30 | public function copy(): Pair |
|
62 | |||
63 | /** |
||
64 | * Debug Info |
||
65 | * |
||
66 | * @return array |
||
67 | */ |
||
68 | 3 | public function __debugInfo() |
|
72 | |||
73 | /** |
||
74 | * @inheritDoc |
||
75 | */ |
||
76 | 8 | public function toArray(): array |
|
80 | |||
81 | /** |
||
82 | * |
||
83 | */ |
||
84 | 1 | public function jsonSerialize() |
|
88 | |||
89 | /** |
||
90 | * To String |
||
91 | */ |
||
92 | 1 | public function __toString() |
|
96 | } |
||
97 |