Skip to content

Commit a891aa2

Browse files
committed
minor #13386 use NotNull instead of NotBlank (xabbuh)
This PR was merged into the master branch. Discussion ---------- use NotNull instead of NotBlank Since we have the `Type` constraint enforcing strings and the `Length` constraint ensuring that the empty strings are rejected, wouldn't it be more sensible to use the more strict `NotNull` constraint? Commits ------- f574acb use NotNull instead of NotBlank
2 parents 8b2f522 + f574acb commit a891aa2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

reference/constraints/Sequentially.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You can validate each of these constraints sequentially to solve these issues:
5757
* @var string
5858
*
5959
* @Assert\Sequentially({
60-
* @Assert\NotBlank(),
60+
* @Assert\NotNull(),
6161
* @Assert\Type("string"),
6262
* @Assert\Length(min=10),
6363
* @Assert\Regex(Place::ADDRESS_REGEX),
@@ -74,7 +74,7 @@ You can validate each of these constraints sequentially to solve these issues:
7474
properties:
7575
address:
7676
- Sequentially:
77-
- NotBlank: ~
77+
- NotNull: ~
7878
- Type: string
7979
- Length: { min: 10 }
8080
- Regex: !php/const App\Localization\Place::ADDRESS_REGEX
@@ -91,7 +91,7 @@ You can validate each of these constraints sequentially to solve these issues:
9191
<class name="App\Localization\Place">
9292
<property name="address">
9393
<constraint name="Sequentially">
94-
<constraint name="NotBlank"/>
94+
<constraint name="NotNull"/>
9595
<constraint name="Type">string</constraint>
9696
<constraint name="Length">
9797
<option name="min">10</option>
@@ -119,7 +119,7 @@ You can validate each of these constraints sequentially to solve these issues:
119119
public static function loadValidatorMetadata(ClassMetadata $metadata)
120120
{
121121
$metadata->addPropertyConstraint('address', new Assert\Sequentially([
122-
new Assert\NotBlank(),
122+
new Assert\NotNull(),
123123
new Assert\Type("string"),
124124
new Assert\Length(['min' => 10]),
125125
new Assert\Regex(self::ADDRESS_REGEX),

0 commit comments

Comments
 (0)