Skip to content

Make "NewlineAfterStatementRector" and "NewlineBetweenClassLikeStmtsRector" optional #9917

Closed

Description

@kevin-emo

Would it be possible to make these two specific rules either opt-in, configurable, or both ?

Of course, they can easily be skipped, but from my perspective, it feels odd to have such opinionated coding style rules enforced by default in sets.

In my case, I have been skipping them for years now, ever since I started using Rector.

Activity

  1. TomasVotruba commented on Oct 6, 2026

    @TomasVotruba
    Member

    In case the full class changes, the php-parser sometimes up messes up spacing between class elements.
    Same applies for some class method changes and inner body.

    That's why we have these rules out of the box. It's a no brainer.

  2. TomasVotruba commented on Nov 17, 2026

    @TomasVotruba
    Member

    I'm revisiting one rule, as way too opinionated and not really hepful code-flow-wise: rectorphp/rector-src#8975
    Indeed it better fits a coding standard rule. Thanks for feedback 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions