File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed 
src/Tempest/Core/src/Kernel Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 77use  FilesystemIterator ;
88use  RecursiveDirectoryIterator ;
99use  RecursiveIteratorIterator ;
10+ use  ReflectionException ;
1011use  SplFileInfo ;
1112use  Tempest \Container \Container ;
1213use  Tempest \Core \DiscoversPath ;
@@ -32,11 +33,15 @@ public function __invoke(): void
3233            /** @var Discovery $discovery */ 
3334            $ discovery$ this container ->get ($ discoveryClass
3435
35-             if  ($ this kernel ->discoveryCache  && $ discoveryhasCache ()) {
36-                 $ discoveryrestoreCache ($ this container );
37-                 next ($ this kernel ->discoveryClasses );
36+             try  {
37+                 if  ($ this kernel ->discoveryCache  && $ discoveryhasCache ()) {
38+                     $ discoveryrestoreCache ($ this container );
39+                     next ($ this kernel ->discoveryClasses );
3840
39-                 continue ;
41+                     continue ;
42+                 }
43+             } catch  (ReflectionException 
44+                 // Invalid cache 
4045            }
4146
4247            foreach  ($ this kernel ->discoveryLocations  as  $ discoveryLocation
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments