Skip to content

Commit

Permalink
Merge pull request #1970 from FriendsOfSymfony/fix
Browse files Browse the repository at this point in the history
Apply NotBlank only to the whole array
  • Loading branch information
GuilhemN authored Jan 2, 2019
2 parents 5701cb9 + 193161d commit ce2abfc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions Controller/Annotations/AbstractScalarParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public function getConstraints()
if (false === $this->nullable) {
$constraints[] = new NotNull();
}
if (false === $this->allowBlank) {
$constraints[] = new NotBlank();
}
}

return $constraints;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Controller/Annotations/AbstractScalarParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testArrayWithBlankConstraintsWhenParamIsAnArray()
$this->assertEquals(array(new Constraints\All(array(
new Constraints\NotNull(),
new Constraints\NotBlank(),
)), new Constraints\NotNull(), new Constraints\NotBlank()), $this->param->getConstraints());
)), new Constraints\NotNull()), $this->param->getConstraints());
}

public function testArrayWithNoConstraintsDoesNotCreateInvalidConstraint()
Expand Down

0 comments on commit ce2abfc

Please sign in to comment.