Skip to content

Commit

Permalink
Ensure there are always at least 2 constraints in a multi constraint,…
Browse files Browse the repository at this point in the history
… refs #129
  • Loading branch information
Seldaek authored Feb 4, 2022
1 parent 3976a9e commit 84ce71b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Constraint/MultiConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ public static function create(array $constraints, $conjunctive = true)
return new MatchAllConstraint();
}
unset($constraints[$k]);
if (1 === \count($constraints)) {
return $constraints[0];
}
}
}

Expand Down

0 comments on commit 84ce71b

Please sign in to comment.