-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#3263Labels
Description
Bug Report
Hi, it seems that TypedPropertyFromAssignsRector rule delete too many comments above the property when it's applied. I guess it's due to the VarTagRemover involved in the rule ?
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| 0.15.1 | 7.4 |
Minimal PHP Code Causing Issue
See https://getrector.org/demo/88c48c30-05e1-4e29-b5b5-22fe0339e324
<?php
final class Demo
{
// A comment
/**
* Another comment
*/
/**
* @var \DateTime
*/
private $property;
public function __construct()
{
$this->property = new \DateTime();
}
}Responsible rules
TypedPropertyFromAssignsRector
Actual behavior
final class Demo
{
- // A comment
-
- /**
- * Another comment
- */
-
- /**
- * @var \DateTime
- */
- private $property;
+ private \DateTime $property;
public function __construct()
{Expected Behavior
final class Demo
{
// A comment
/**
* Another comment
*/
- /**
- * @var \DateTime
- */
- private $property;
+ private \DateTime $property;
public function __construct()
{
```Reactions are currently unavailable