Skip to content

Commit

Permalink
after CR
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Apr 5, 2024
1 parent 01555b4 commit 8cd55ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/lib/Query/Content/CriterionVisitor/IsContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
$value = $criterion->value;

if (!is_array($value) || !is_bool($value[0])) {
throw new \LogicException('Criterion value should be of type array<bool>');
throw new \LogicException(sprintf(
'%s value should be of type array<bool>, received %s.',
Criterion\IsContainer::class,
get_debug_type($value),
));
}

return 'content_type_is_container_b:' . ($value[0] ? 'true' : 'false');
Expand Down
6 changes: 5 additions & 1 deletion src/lib/Query/Location/CriterionVisitor/IsContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
$value = $criterion->value;

if (!is_array($value) || !is_bool($value[0])) {
throw new \LogicException('Criterion value should be of type array<bool>');
throw new \LogicException(sprintf(
'%s value should be of type array<bool>, received %s.',
Criterion\IsContainer::class,
get_debug_type($value),
));
}

return 'is_container_b:' . ($value[0] ? 'true' : 'false');
Expand Down

0 comments on commit 8cd55ed

Please sign in to comment.