File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed
Tests/Fixtures/Validation Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,23 @@ public function warmUp($cacheDir)
6666 $ loaders = $ this ->validatorBuilder ->getLoaders ();
6767 $ metadataFactory = new LazyLoadingMetadataFactory (new LoaderChain ($ loaders ), new Psr6Cache ($ arrayPool ));
6868
69- foreach ($ this ->extractSupportedLoaders ($ loaders ) as $ loader ) {
70- foreach ($ loader ->getMappedClasses () as $ mappedClass ) {
71- if ($ metadataFactory ->hasMetadataFor ($ mappedClass )) {
72- $ metadataFactory ->getMetadataFor ($ mappedClass );
69+ $ throwingAutoloader = function ($ class ) { throw new \ReflectionException (sprintf ('Class %s does not exist ' , $ class )); };
70+ spl_autoload_register ($ throwingAutoloader );
71+
72+ try {
73+ foreach ($ this ->extractSupportedLoaders ($ loaders ) as $ loader ) {
74+ foreach ($ loader ->getMappedClasses () as $ mappedClass ) {
75+ try {
76+ if ($ metadataFactory ->hasMetadataFor ($ mappedClass )) {
77+ $ metadataFactory ->getMetadataFor ($ mappedClass );
78+ }
79+ } catch (\ReflectionException $ e ) {
80+ // ignore failing reflection
81+ }
7382 }
7483 }
84+ } finally {
85+ spl_autoload_unregister ($ throwingAutoloader );
7586 }
7687
7788 $ values = $ arrayPool ->getValues ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Symfony \Bundle \FrameworkBundle \Tests \Fixtures \Validation ;
4+
5+ class Article implements NotExistingInterface
6+ {
7+ public $ category ;
8+ }
Original file line number Diff line number Diff line change 1616 </property >
1717 </class >
1818
19- <class name =" Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\NonExistentClass " >
20- <property name =" gender " >
19+ <class name =" Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\Article " >
20+ <property name =" category " >
2121 <constraint name =" Choice" >
2222 <option name =" choices" >
2323 <value >other</value >
You can’t perform that action at this time.
0 commit comments