Skip to content

Add FileCollection filter and visit methods #76

Closed
@codeliner

Description

@codeliner

As discussed in the chat, instead of iterating over FileCollection in FileCodeGenerator and use skip callback, this library should offer a simpler to understand API:

$fileCollection->filter(
  fn (File $file) => !skip_callable($file)
)->visit(
  fn (File $file) => $fileCodeGenerator->addGetterMethodsForProperties($file)  
);

So FileCollection provides chainable helper methods and FileCodeGenerator has a much simpler and more clear interface.
Changing FileCodeGenerator is a BC break. We should deprecate the old methods first and add new methods that just work with single File instances (f.e. @deprecated addGetterMethodsForProperties -> addPropertiesGetterMethods(File $file)).

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