@@ -106,14 +106,15 @@ prefixed classes included in doc block comments (``/** ... */``). For example::
106106 }
107107
108108To 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
119120To 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();