Skip to content

Commit ce2abfc

Browse files
authored
Merge pull request #1970 from FriendsOfSymfony/fix
Apply NotBlank only to the whole array
2 parents 5701cb9 + 193161d commit ce2abfc

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Controller/Annotations/AbstractScalarParam.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ public function getConstraints()
6969
if (false === $this->nullable) {
7070
$constraints[] = new NotNull();
7171
}
72-
if (false === $this->allowBlank) {
73-
$constraints[] = new NotBlank();
74-
}
7572
}
7673

7774
return $constraints;

Tests/Controller/Annotations/AbstractScalarParamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testArrayWithBlankConstraintsWhenParamIsAnArray()
107107
$this->assertEquals(array(new Constraints\All(array(
108108
new Constraints\NotNull(),
109109
new Constraints\NotBlank(),
110-
)), new Constraints\NotNull(), new Constraints\NotBlank()), $this->param->getConstraints());
110+
)), new Constraints\NotNull()), $this->param->getConstraints());
111111
}
112112

113113
public function testArrayWithNoConstraintsDoesNotCreateInvalidConstraint()

0 commit comments

Comments
 (0)