Skip to content

Indentation change in mixed HTML/PHP file that's unaffected by rule #7845

@schlndh

Description

@schlndh

Bug Report

Subject Details
Rector version e11572 / v0.15.21

I tried rector on a project and I noticed that it made unnecessary indentation changes in a few mixed HTML/PHP files that were otherwise unaffected by the rules I applied. It's not a big deal for me (it only affected about 10-20 files out of a few thousand), just slightly annoying.

Minimal PHP Code Causing Issue

https://getrector.com/demo/98b16ff4-f832-4041-8e37-896e4575ce16

The cause seems to be the comment just before ?>. If I replace it with a statement (e.g. $v = 1;), the it works correctly.

Expected Behaviour

The file should remain as is.

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