Skip to content

Commit 805b0dd

Browse files
committed
fix: toArray has low priority
1 parent 43e0302 commit 805b0dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Helper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ public static function asArray($data)
1717
return $data;
1818
}
1919

20-
if (\method_exists($data, 'toArray')) {
21-
return $data->toArray();
22-
}
23-
2420
if ($data instanceof Underscore) {
2521
return $data->get();
2622
}
@@ -35,6 +31,10 @@ public static function asArray($data)
3531
return $data->jsonSerialize();
3632
}
3733

34+
if (\method_exists($data, 'toArray')) {
35+
return $data->toArray();
36+
}
37+
3838
return (array) $data;
3939
}
4040
}

0 commit comments

Comments
 (0)