File tree 1 file changed +4
-2
lines changed
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
267
267
$ pathPart = 'stubs/ ' . dirname ($ relativeStubPath ) . '/ ' . str_replace ('\\' , '/ ' , $ namespacedName ) . '.php ' ;
268
268
$ targetStubPath = __DIR__ . '/../ ' . $ pathPart ;
269
269
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_ ) {
271
271
if (array_key_exists (strtolower ($ namespacedName ), $ classes )) {
272
272
continue ;
273
273
}
274
274
$ classes [strtolower ($ namespacedName )] = $ pathPart ;
275
275
$ stmt = $ this ->filterClassPhpDocs ($ stmt );
276
- } else {
276
+ } elseif ( $ stmt instanceof Node \ Stmt \Function_) {
277
277
if (in_array ($ namespacedName , ['_exit ' , '_die ' ], true )) {
278
278
continue ;
279
279
}
280
280
if (array_key_exists (strtolower ($ namespacedName ), $ functions )) {
281
281
continue ;
282
282
}
283
283
$ 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 ()));
284
286
}
285
287
286
288
$ originalStmt = $ stmt ;
You can’t perform that action at this time.
0 commit comments