Skip to content

Commit

Permalink
[Feature] Allow null value for has-delimeter filter (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: M@ster <[email protected]>
  • Loading branch information
bbprojectnet and bbprojectnet authored Jul 16, 2021
1 parent 82092a0 commit 47b8e53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Filters/Concerns/HasDelimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function delimiter(string $delimiter): self
/**
* Convert the provided value to an array.
*
* @param string|array $value
* @param string|array|null $value
* @return array
*/
protected function toArray($value): array
Expand All @@ -60,6 +60,10 @@ protected function toArray($value): array
return $value;
}

if (\is_null($value)) {
return [];
}

throw new \LogicException(
'Expecting filter value to be an array, or a string when a string delimiter is set.'
);
Expand Down

0 comments on commit 47b8e53

Please sign in to comment.