Skip to content

Commit 186bff4

Browse files
committed
Improve
1 parent ac033d7 commit 186bff4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/App/Helper/MinMaxHelper.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ private function appendCollectionDoc(CollectionDoc $doc, Constraint $constraint)
8181
} elseif ($constraint instanceof Assert\NotBlank && null === $doc->getMinItem()) {
8282
// Not blank so minimum 1 item
8383
$doc->setMinItem(1);
84-
}/* // Documentation does not mention array, counter to NotBlank constraint
85-
elseif ($constraint instanceof Assert\Blank && null === $doc->getMaxItem()) {
86-
// Blank so maximum 0 item
87-
$doc->setMaxItem(0);
88-
}*/
89-
if ($constraint instanceof Assert\GreaterThan || $constraint instanceof Assert\GreaterThanOrEqual) {
84+
} elseif ($constraint instanceof Assert\GreaterThan || $constraint instanceof Assert\GreaterThanOrEqual) {
9085
$doc->setMinItem(
9186
$constraint instanceof Assert\GreaterThanOrEqual
9287
? $constraint->value
@@ -98,7 +93,11 @@ private function appendCollectionDoc(CollectionDoc $doc, Constraint $constraint)
9893
? $constraint->value
9994
: $constraint->value - 1
10095
);
101-
}
96+
} /* Documentation does not mention array, counter to NotBlank constraint
97+
elseif ($constraint instanceof Assert\Blank && null === $doc->getMaxItem()) {
98+
// Blank so maximum 0 item
99+
$doc->setMaxItem(0);
100+
}*/
102101
}
103102

104103
/**

0 commit comments

Comments
 (0)