Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.054 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 2 | public function create(): ValidatorInterface |
|
30 | { |
||
31 | 2 | $mf = new LazyLoadingMetadataFactory(new AnnotationLoader()); |
|
32 | |||
33 | 2 | $vb = Validation::createValidatorBuilder(); |
|
34 | 2 | $vb->setMetadataFactory($mf); |
|
35 | 2 | if ($this->cacheItemPool) { |
|
36 | $vb->setMappingCache($this->cacheItemPool); |
||
37 | } |
||
38 | |||
39 | 2 | if ($this->translationDomain) { |
|
40 | $vb->setTranslationDomain($this->translationDomain); |
||
41 | } |
||
42 | |||
43 | 2 | $vb->disableAnnotationMapping(); |
|
44 | 2 | $validator = $vb->getValidator(); |
|
45 | |||
46 | 2 | return new Validator($validator); |
|
47 | } |
||
49 |