Skip to content

Fine grained File interfaces #77

Closed
@codeliner

Description

@codeliner

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 the generate method
  • PhpFile extends File: adds namespace, imports and injectVisitors methods
  • ClassLikeFile extends PhpFile: 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions