Skip to content

Commit 193161d

Browse files
committed
Fix
1 parent 682ca1a commit 193161d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Controller/Annotations/AbstractScalarParam.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function getConstraints()
5656
));
5757
}
5858

59+
if (false === $this->allowBlank) {
60+
$constraints[] = new NotBlank();
61+
}
62+
5963
// If the user wants to map the value, apply all constraints to every
6064
// value of the map
6165
if ($this->map) {
@@ -67,10 +71,6 @@ public function getConstraints()
6771
}
6872
}
6973

70-
if (false === $this->allowBlank) {
71-
$constraints[] = new NotBlank();
72-
}
73-
7474
return $constraints;
7575
}
7676
}

Tests/Controller/Annotations/AbstractScalarParamTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ public function testArrayWithBlankConstraintsWhenParamIsAnArray()
106106
$this->param->allowBlank = false;
107107
$this->assertEquals(array(new Constraints\All(array(
108108
new Constraints\NotNull(),
109-
)), new Constraints\NotNull(), new Constraints\NotBlank()), $this->param->getConstraints());
109+
new Constraints\NotBlank(),
110+
)), new Constraints\NotNull()), $this->param->getConstraints());
110111
}
111112

112113
public function testArrayWithNoConstraintsDoesNotCreateInvalidConstraint()

0 commit comments

Comments
 (0)