Skip to content

Is there any valid reason Rector should run more than once for one file? #7084

@alexkramer98

Description

@alexkramer98

Question

I came accross this, for example, using the AnnotationToAttributeRector combined with NewlineAfterStatementRector. The first pass converts the annotations to attributes, and the next pass (re-)adds the newlines. I would expect both of these rules to do their magic in a single pass.

I found this behavior with ECS as well. I understand a bug could be causing the file to change, so that it has to be parsed again for a complete refactoring.

However, I am wondering if there would be any valid reason for this behavior to occur beyond of the scope of bugs -- if there is, how do I know (up front?) how many passes are needed for a file? One, two, maybe even more?

What is your point of view about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions