Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce6d9f3

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Calling enableAnnotationMapping without argument is deprecated
2 parentse4c5aef +017ecd7 commitce6d9f3

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

‎components/validator/resources.rst‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,15 @@ prefixed classes included in doc block comments (``/** ... */``). For example::
106106
}
107107

108108
To enable the annotation loader, call the
109-
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping`
110-
method. It takes an optional annotation reader instance, which defaults to
111-
``Doctrine\Common\Annotations\AnnotationReader``::
109+
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::enableAnnotationMapping` method
110+
and then call ``addDefaultDoctrineAnnotationReader()`` to use Doctrine's
111+
annotation reader::
112112

113113
use Symfony\Component\Validator\Validation;
114114

115115
$validator = Validation::createValidatorBuilder()
116-
->enableAnnotationMapping()
116+
->enableAnnotationMapping(true)
117+
->addDefaultDoctrineAnnotationReader()
117118
->getValidator();
118119

119120
To disable the annotation loader after it was enabled, call
@@ -134,7 +135,8 @@ multiple mappings::
134135
use Symfony\Component\Validator\Validation;
135136

136137
$validator = Validation::createValidatorBuilder()
137-
->enableAnnotationMapping()
138+
->enableAnnotationMapping(true)
139+
->addDefaultDoctrineAnnotationReader()
138140
->addMethodMapping('loadValidatorMetadata')
139141
->addXmlMapping('validator/validation.xml')
140142
->getValidator();

‎form/unit_testing.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ allows you to return a list of extensions to register::
219219

220220
// or if you also need to read constraints from annotations
221221
$validator = Validation::createValidatorBuilder()
222-
->enableAnnotationMapping()
222+
->enableAnnotationMapping(true)
223+
->addDefaultDoctrineAnnotationReader()
223224
->getValidator();
224225

225226
return [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp