-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#5744Labels
Description
Bug Report
It looks like the refactoring of class properties to promoted constructor properties doesn't work as expected in this case (presumably because it's using the var keyword?)
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/3b9b99c4-80ee-46d1-b408-85833b215ce3
<?php
class test {
var $id;
public function __construct($id) {
$this->id = $id;
}
}Responsible rules
ClassPropertyAssignToConstructorPromotionRector
Expected Behavior
Rector should leave this alone. If combined with VarToPublicPropertyRector (as in the up to PHP 8.2 set) it should change the var to a public property and then to a promoted constructor parameter.
Reactions are currently unavailable