Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | class ArrayObject extends BaseArrayObject implements JsonSerializable, Serializable |
||
14 | { |
||
15 | /** |
||
16 | * Get the instance as an array. |
||
17 | * |
||
18 | * @return array |
||
19 | */ |
||
20 | public function toArray() |
||
21 | { |
||
22 | return $this->getArrayCopy(); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @inheritDoc |
||
27 | */ |
||
28 | public function serialize() |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Constructs the object. |
||
35 | * @link https://php.net/manual/en/serializable.unserialize.php |
||
36 | * @param string $serialized The string representation of the object. |
||
37 | * @return void |
||
38 | */ |
||
39 | public function unserialize($data) |
||
40 | { |
||
41 | $data = @unserialize($data); |
||
42 | if (!is_array($data)) { |
||
43 | return; |
||
44 | } |
||
45 | foreach ($data as $property => $value) { |
||
46 | $this[$property] = $value; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Get the array that should be JSON serialized. |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | public function jsonSerialize() |
||
58 | } |
||
59 | } |
||
60 |