8000 Missing Namespace and comment form validation context · symfony/symfony-docs@37540f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 37540f2

Browse files
gary houbrejaviereguiluz
gary houbre
authored andcommitted
Missing Namespace and comment form validation context
1 parent 72a2b1c commit 37540f2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

validation/custom_constraint.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ You can use custom validators like the ones provided by Symfony itself:
115115
.. code-block:: php-annotations
116116
117117
// src/Entity/AcmeEntity.php
118+
namespace App\Entity;
119+
118120
use App\Validator\Constraints as AcmeAssert;
119121
use Symfony\Component\Validator\Constraints as Assert;
120122
@@ -159,6 +161,8 @@ You can use custom validators like the ones provided by Symfony itself:
159161
.. code-block:: php
160162
161163
// src/Entity/AcmeEntity.php
164+
namespace App\Entity;
165+
162166
use App\Validator\Constraints\ContainsAlphanumeric;
163167
use Symfony\Component\Validator\Constraints\NotBlank;
164168
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -249,6 +253,8 @@ not to the property:
249253
.. code-block:: php
250254
251255
// src/Entity/AcmeEntity.php
256+
namespace App\Entity;
257+
252258
use App\Validator\Constraints\ProtocolClass;
253259
use Symfony\Component\Validator\Mapping\ClassMetadata;
254260

validation/sequence_provider.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ that group are valid, the second group, ``Strict``, will be validated.
149149

150150
You can also define a group sequence in the ``validation_groups`` form option::
151151

152+
// src/Form/MyType.php
153+
namespace App\Form;
154+
152155
use Symfony\Component\Form\AbstractType;
153156
use Symfony\Component\OptionsResolver\OptionsResolver;
154157
use Symfony\Component\Validator\Constraints\GroupSequence;

validation/translations.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ property is not empty, add the following:
2828
.. code-block:: php-annotations
2929
3030
// src/Entity/Author.php
31+
namespace App\Entity;
32+
3133
use Symfony\Component\Validator\Constraints as Assert;
3234
3335
class Author
@@ -67,6 +69,7 @@ property is not empty, add the following:
6769
.. code-block:: php
6870
6971
// src/Entity/Author.php
72+
namespace App\Entity;
7073
7174
// ...
7275
use Symfony\Component\Validator\Constraints\NotBlank;

0 commit comments

Comments
 (0)
0