-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | 2.0.6 |
Hi People,
I discovered a problem during my development.
Indeed, on the rule "NewlineBeforeNewAssignSetRector", I had a very strange case, and I only reproduced it within a class. Here is the initial code:
class Foo
{
public function bar(): void
{
$bar = new \stdClass();
$bar->barFoo = false;
$barFoo = new \stdClass();
$barFoo->tokenize = false;
}
}Rector tries to add a line after the second class declaration.
class Foo
{
public function bar(): void
{
$bar = new \stdClass();
$bar->barFoo = false;
$barFoo = new \stdClass();
$barFoo->tokenize = false;
}
}By trying several different cases it turns out that my property must have the same name as my next variable. In my case ->barFoo and $barFoo.
Minimal PHP Code Causing Issue
Expected Behaviour
For me is a bug in rector but i'm not sure !