File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -267,20 +267,22 @@ public function clear(): void
267267 $ pathPart = 'stubs/ ' . dirname ($ relativeStubPath ) . '/ ' . str_replace ('\\' , '/ ' , $ namespacedName ) . '.php ' ;
268268 $ targetStubPath = __DIR__ . '/../ ' . $ pathPart ;
269269
270- if ($ stmt instanceof Node \Stmt \Class_ || $ stmt instanceof Node \Stmt \Interface_ || $ stmt instanceof Node \Stmt \Trait_) {
270+ if ($ stmt instanceof Node \Stmt \Class_ || $ stmt instanceof Node \Stmt \Interface_ || $ stmt instanceof Node \Stmt \Trait_ || $ stmt instanceof Node \ Stmt \Enum_ ) {
271271 if (array_key_exists (strtolower ($ namespacedName ), $ classes )) {
272272 continue ;
273273 }
274274 $ classes [strtolower ($ namespacedName )] = $ pathPart ;
275275 $ stmt = $ this ->filterClassPhpDocs ($ stmt );
276- } else {
276+ } elseif ( $ stmt instanceof Node \ Stmt \Function_) {
277277 if (in_array ($ namespacedName , ['_exit ' , '_die ' ], true )) {
278278 continue ;
279279 }
280280 if (array_key_exists (strtolower ($ namespacedName ), $ functions )) {
281281 continue ;
282282 }
283283 $ functions [strtolower ($ namespacedName )] = $ pathPart ;
284+ } else {
285+ throw new \Exception (sprintf ('Unhandled node type %s in %s on line %s. ' , get_class ($ stmt ), $ stubPath , $ stmt ->getLine ()));
284286 }
285287
286288 $ originalStmt = $ stmt ;
You can’t perform that action at this time.
0 commit comments