Closed
Description
The File interface raises some questions. Its methods imply that we are dealing with a class or interface file, but what about config files or files that only contain functions?
My suggestion is to use dedicated interfaces that extend each other:
File
: very basic, maybe only contains thegenerate
methodPhpFile
extendsFile
: adds namespace, imports andinjectVisitors
methodsClassLikeFile
extendsPhpFile
: adds all class/interface related methods
Does it make sense for this library to support non-PHP files? Or should those be handled outside of php-code-ast?
Metadata
Metadata
Assignees
Labels
No labels