Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Hyde\Support\Contracts; |
| 6 | |
| 7 | use Illuminate\Contracts\Support\Arrayable; |
| 8 | use Illuminate\Contracts\Support\Jsonable; |
| 9 | use JsonSerializable; |
| 10 | |
| 11 | /** |
| 12 | * Specifies that a class can be serialized to an array and/or JSON. |
| 13 | * |
| 14 | * @template TKey of array-key |
| 15 | * @template TValue |
| 16 | */ |
| 17 | interface SerializableContract extends JsonSerializable, Arrayable, Jsonable |
| 18 | { |
| 19 | /** |
| 20 | * Specify data which should be serialized to JSON. |
| 21 | * |
| 22 | * @return array<TKey, TValue> |
| 23 | */ |
| 24 | public function jsonSerialize(): array; |
| 25 | |
| 26 | /** |
| 27 | * Get the instance as an array. |
| 28 | * |
| 29 | * @return array<TKey, TValue> |
| 30 | */ |
| 31 | public function toArray(): array; |
| 32 | |
| 33 | /** |
| 34 | * Convert the instance to its JSON representation. |
| 35 | * |
| 36 | * @param int $options |
| 37 | */ |
| 38 | public function toJson($options = 0): string; |
| 39 | } |