@@ -163,22 +163,24 @@ private function isVariadic(): bool
163163 $ isNativelyVariadic = $ this ->reflection ->isVariadic ();
164164 if (!$ isNativelyVariadic && $ this ->reflection ->getFileName () !== false ) {
165165 $ fileName = $ this ->reflection ->getFileName ();
166- $ functionName = $ this ->reflection ->getName ();
167- $ modifiedTime = filemtime ($ fileName );
168- if ($ modifiedTime === false ) {
169- $ modifiedTime = time ();
170- }
171- $ variableCacheKey = sprintf ('%d-v1 ' , $ modifiedTime );
172- $ key = sprintf ('variadic-function-%s-%s ' , $ functionName , $ fileName );
173- $ cachedResult = $ this ->cache ->load ($ key , $ variableCacheKey );
174- if ($ cachedResult === null ) {
175- $ nodes = $ this ->parser ->parseFile ($ fileName );
176- $ result = $ this ->callsFuncGetArgs ($ nodes );
177- $ this ->cache ->save ($ key , $ variableCacheKey , $ result );
178- return $ result ;
179- }
166+ if (file_exists ($ fileName )) {
167+ $ functionName = $ this ->reflection ->getName ();
168+ $ modifiedTime = filemtime ($ fileName );
169+ if ($ modifiedTime === false ) {
170+ $ modifiedTime = time ();
171+ }
172+ $ variableCacheKey = sprintf ('%d-v1 ' , $ modifiedTime );
173+ $ key = sprintf ('variadic-function-%s-%s ' , $ functionName , $ fileName );
174+ $ cachedResult = $ this ->cache ->load ($ key , $ variableCacheKey );
175+ if ($ cachedResult === null ) {
176+ $ nodes = $ this ->parser ->parseFile ($ fileName );
177+ $ result = $ this ->callsFuncGetArgs ($ nodes );
178+ $ this ->cache ->save ($ key , $ variableCacheKey , $ result );
179+ return $ result ;
180+ }
180181
181- return $ cachedResult ;
182+ return $ cachedResult ;
183+ }
182184 }
183185
184186 return $ isNativelyVariadic ;
0 commit comments