Skip to content

Commit

Permalink
MAKAIRA-4359 Apply feedback from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
duongnfq841992 committed Apr 8, 2024
1 parent f665527 commit 80e1735
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function setConstraint($constraint, $value)
public function verify()
{
foreach ($this->getMandatoryConstraints() as $key => $label) {
if (!$this->isConstraintExists($key)) {
if (empty($this->constraints[$key])) {
throw new DomainException(sprintf('Missing mandatory %s constraint.', $label));
}
}
Expand Down Expand Up @@ -116,17 +116,4 @@ public static function createFromRequest($data)
->verify()
->filterConstraints();
}

private function isConstraintExists($key)
{
if (!isset($this->constraints[$key])) {
return false;
}

if ('' === $this->constraints[$key]) {
return false;
}

return true;
}
}

0 comments on commit 80e1735

Please sign in to comment.