Total Complexity | 1 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
6 | trait JsonSerializableTrait |
||
7 | { |
||
8 | /** |
||
9 | * Returns class properties as an array. |
||
10 | * |
||
11 | * @return array |
||
12 | */ |
||
13 | abstract public function asArray(): array; |
||
14 | |||
15 | /** |
||
16 | * Specify data which should be serialized to JSON. |
||
17 | * |
||
18 | * Serializes the object to a value that can be serialized natively by `json_encode()`. |
||
19 | * |
||
20 | * @return mixed Returns data which can be serialized by `json_encode()`, |
||
21 | * which is a value of any type other than a `resource`. |
||
22 | * |
||
23 | * @link https://php.net/manual/en/jsonserializable.jsonserialize.php JsonSerializable::jsonSerialize |
||
24 | */ |
||
25 | public function jsonSerialize() |
||
30 |