Skip to content

Commit

Permalink
Fix: filter helpers now accepts non array arguments
Browse files Browse the repository at this point in the history
fix #7
  • Loading branch information
breadlesscode committed Jun 12, 2019
1 parent 9a69c05 commit 292640e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FilterByCategoriesOperation extends FilterByReferencesOperation
public function evaluate(FlowQuery $flowQuery, array $arguments)
{
if (!is_array($arguments[0])) {
throw new FlowQueryException('The first parameter of '.self::$shortName.' should be an array');
$arguments[1] = [ $arguments[1] ];
}

$context = \array_filter($flowQuery->getContext(), $this->getReferenceFilter('categories', $arguments[0]));
Expand Down
2 changes: 1 addition & 1 deletion Classes/FlowQuery/Operations/FilterByTagsOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FilterByTagsOperation extends FilterByReferencesOperation
public function evaluate(FlowQuery $flowQuery, array $arguments)
{
if (!is_array($arguments[0])) {
throw new FlowQueryException('The first parameter of '.self::$shortName.' should be an array');
$arguments[1] = [ $arguments[1] ];
}

$context = \array_filter($flowQuery->getContext(), $this->getReferenceFilter('tags', $arguments[0]));
Expand Down

0 comments on commit 292640e

Please sign in to comment.