File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -106,15 +106,15 @@ prefixed classes included in doc block comments (``/** ... */``). For example::
106
106
}
107
107
108
108
To enable the annotation loader, call the
109
- :method: `Symfony\\ Component\\ Validator\\ ValidatorBuilder::enableAnnotationMapping ` method
110
- and then call `` addDefaultDoctrineAnnotationReader() `` to use Doctrine's
111
- annotation reader::
109
+ :method: `Symfony\\ Component\\ Validator\\ ValidatorBuilder::enableAnnotationMapping ` method.
110
+ If you use annotations instead of attributes, it's also required to call
111
+ `` addDefaultDoctrineAnnotationReader() `` to use Doctrine's annotation reader::
112
112
113
113
use Symfony\Component\Validator\Validation;
114
114
115
115
$validator = Validation::createValidatorBuilder()
116
- ->enableAnnotationMapping(true )
117
- ->addDefaultDoctrineAnnotationReader()
116
+ ->enableAnnotationMapping()
117
+ ->addDefaultDoctrineAnnotationReader() // Only if annotations are used
118
118
->getValidator();
119
119
120
120
To disable the annotation loader after it was enabled, call
You can’t perform that action at this time.
0 commit comments