1 | <?php |
||
7 | abstract class DataObject implements \JsonSerializable |
||
8 | { |
||
9 | /** |
||
10 | * @var array The object's data cache. |
||
11 | */ |
||
12 | public $data = []; |
||
13 | |||
14 | /** |
||
15 | * Creates a data object from an array of data. |
||
16 | * |
||
17 | * @param array $data The array containing object data. |
||
18 | * |
||
19 | * @return self A new object instance. |
||
20 | */ |
||
21 | 18 | public static function fromData(array $data) |
|
29 | |||
30 | /** |
||
31 | * Returns scalar data to be serialized. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function jsonSerialize() |
||
39 | |||
40 | /** |
||
41 | * Re-initializes the object when unserialized or created from a data array. |
||
42 | * |
||
43 | * @param array $data The object data. |
||
44 | */ |
||
45 | 4 | public function jsonUnserialize(array $data) |
|
48 | } |
||
49 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.