Only enable Choice and InstanceOfConstraints if a value is provided

This commit is contained in:
Jan Böhmer 2023-06-18 21:20:07 +02:00
parent 7d99607919
commit 218b0adb8f
2 changed files with 2 additions and 2 deletions

View file

@ -70,7 +70,7 @@ class ChoiceConstraint extends AbstractConstraint
public function isEnabled(): bool
{
return $this->operator !== '';
return $this->operator !== '' && count($this->value) > 0;
}
public function apply(QueryBuilder $queryBuilder): void

View file

@ -77,7 +77,7 @@ class InstanceOfConstraint extends AbstractConstraint
public function isEnabled(): bool
{
return $this->operator !== '';
return $this->operator !== '' && count($this->value) > 0;
}
public function apply(QueryBuilder $queryBuilder): void