Skip to content

Commit 7b04615

Browse files
committed
Allow carbon in createFromArray
1 parent ada5634 commit 7b04615

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Model/DefaultSearch/Query/DateFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public static function createFromArray(string $field, array $params, bool $round
6666
}
6767

6868
foreach ($params as $key => $value) {
69-
if (!is_int($value)) {
69+
if (!is_int($value) && (!$value instanceof Carbon)) {
7070
throw new InvalidArgumentException(
7171
sprintf(
72-
'Invalid value for parameter %s, expected integer, got %s',
72+
'Invalid value for parameter %s, expected integer or instanceof of Carbon, got %s',
7373
$key,
7474
gettype($value)
7575
)

0 commit comments

Comments
 (0)