@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | if (!($data instanceof self)) throw new \Exception(" It's not a model."); |
47 | 47 | |
48 | - $data = array_map(function ($object) { |
|
48 | + $data = array_map(function($object) { |
|
49 | 49 | return $object->toArray(); |
50 | 50 | }, $data); |
51 | 51 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | if (is_null($offset)) { |
95 | 95 | $data[] = $value; |
96 | - } else { |
|
96 | + }else { |
|
97 | 97 | $data[$offset] = $value; |
98 | 98 | } |
99 | 99 | } |
@@ -43,7 +43,9 @@ |
||
43 | 43 | */ |
44 | 44 | public static function toList($data) |
45 | 45 | { |
46 | - if (!($data instanceof self)) throw new \Exception(" It's not a model."); |
|
46 | + if (!($data instanceof self)) { |
|
47 | + throw new \Exception(" It's not a model."); |
|
48 | + } |
|
47 | 49 | |
48 | 50 | $data = array_map(function ($object) { |
49 | 51 | return $object->toArray(); |