-
-
Notifications
You must be signed in to change notification settings - Fork 738
Incorrect behavior of RemoveUnusedPromotedPropertyRector, RemoveUnusedPrivatePropertyRector #6822
Copy link
Copy link
Closed
rectorphp/rector-src
#1337Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-master |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
<?php
final class DemoSetting extends AbstractSetting
{
private PageInterface $page;
private SectionInterface $section;
public function __construct(PageInterface $page, SectionInterface $section)
{
$this->page = $page;
$this->section = $section;
parent::__construct($page, $section);
}
public function getPage()
{
return $this->page;
}
}
abstract class AbstractSetting
{
public function __construct(PageInterface $page, SectionInterface $section)
{
// do something with $page and $section
$page->runSomething();
$section->runSomething();
}
}Responsible rules
-
RemoveUnusedPromotedPropertyRector -
RemoveUnusedPrivatePropertyRector
Expected Behavior
Rector should not remove the constructor parameter $section from DemoSetting, since this gets passed to the parent::__construct.
Reactions are currently unavailable