-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Do not remove used parameter on RemoveUnusedPrivatePropert…
…yRector (#1337) * [DeadCode] Handle RemoveUnusedPromotedPropertyRector + RemoveUnusedPrivatePropertyRector * rem * move external to Source * eol * fix * eol * [ci-review] Rector Rectify * fix Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
4ad4d16
commit 50bbdd1
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...veUnusedPrivatePropertyRector/Fixture/do_not_remove_used_parameter_in_method_call.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector\Source\AbstractSetting; | ||
|
||
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; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector\Source\AbstractSetting; | ||
|
||
final class DemoSetting extends AbstractSetting | ||
{ | ||
private PageInterface $page; | ||
|
||
public function __construct(PageInterface $page, SectionInterface $section) | ||
{ | ||
$this->page = $page; | ||
|
||
parent::__construct($page, $section); | ||
} | ||
|
||
public function getPage() | ||
{ | ||
return $this->page; | ||
} | ||
} | ||
|
||
?> |
15 changes: 15 additions & 0 deletions
15
...sts/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector/Source/AbstractSetting.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector\Source; | ||
|
||
abstract class AbstractSetting | ||
{ | ||
public function __construct(PageInterface $page, SectionInterface $section) | ||
{ | ||
// do something with $page and $section | ||
$page->runSomething(); | ||
$section->runSomething(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters