-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#7181Closed
Copy link
Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/56b9957e-d1d5-442b-8458-2a54346c2724
<?php
// toplevel
if (true) {
// first innner
f();
// second inner
}Responsible rules
RemoveAlwaysTrueIfConditionRector
Expected Behavior
The refactored php code should keep these both comments:
// toplevelcomment, which is on the above of the if statement.// first innercomment, which is the first statement of if-then block.
In other words, the refactored php code should be like this:
<?php
// toplevel
// first innner
f();
// second innerActual Behavior
The // first inner comment is thrown away.
Reactions are currently unavailable