Bug Report
| Subject |
Details |
| Rector version |
last dev-main |
| Installed as |
composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.org/demo/ad857b8b-eea2-4117-b472-037ee4a9d67f
<?php
final class EqualMirrorPropertyVar
{
/** @psalm-var non-empty-string */
private string $property;
/** @psalm-param non-empty-string $property */
public function __construct(string $property)
{
$this->property = $property;
}
}
Responsible rules
ClassPropertyAssignToConstructorPromotionRector
Expected Behavior
The @psalm-var no need to be copied, as there is already @psalm-param with equal type.
Only move the property to param, psalm-var can be deleted.