Skip to content

Commit 2feed15

Browse files
Collextion update a Time::parse as an Alias to Time::date added
1 parent 6c235ca commit 2feed15

File tree

5 files changed

+36
-251
lines changed

5 files changed

+36
-251
lines changed

src/Collections/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class Collection extends CollectionProperty implements IteratorAggregate, ArrayA
2727
/**
2828
* Create a new collection instance.
2929
*
30-
* @param array $items
30+
* @param array|null $items
3131
*
32-
* @param mixed $instance
32+
* @param mixed $instance
3333
* - [optional] Used on ORM Database Only
3434
* Meant for easy manupulation of collection instance
3535
* This doesn't have affect on using this the Collection class on other projects

src/Collections/CollectionTrait.php

Lines changed: 0 additions & 237 deletions
This file was deleted.

src/Collections/Traits/CollectionTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ protected function getArrayableItems($items)
109109
return $items;
110110
}
111111

112+
if(empty($items) || is_null($items)){
113+
return [];
114+
}
115+
112116
return match (true) {
113117
$items instanceof Traversable => iterator_to_array($items),
114118
$items instanceof JsonSerializable => $items->jsonSerialize(),

0 commit comments

Comments
 (0)