-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Naming] Skip change duplicate type on RenamePropertyToMatchTypeRector (
#161)
- Loading branch information
1 parent
6f59563
commit 84c80e4
Showing
4 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
.../Rector/Class_/RenamePropertyToMatchTypeRector/Fixture/skip_change_duplicate_type.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,24 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Class_\RenamePropertyToMatchTypeRector\Fixture; | ||
|
||
use Rector\Tests\Naming\Rector\Class_\RenamePropertyToMatchTypeRector\Source\EliteManager; | ||
|
||
class SomeClass | ||
{ | ||
/** | ||
* @var EliteManager | ||
*/ | ||
private $eventManager1; | ||
|
||
/** | ||
* @var EliteManager | ||
*/ | ||
private $eventManager2; | ||
|
||
public function __construct(EliteManager $eventManager1, EliteManager $eventManager2) | ||
{ | ||
$this->eventManager1 = $eventManager1; | ||
$this->eventManager2 = $eventManager2; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...or/Class_/RenamePropertyToMatchTypeRector/FixturePhp74/skip_change_duplicate_type.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,24 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Class_\RenamePropertyToMatchTypeRector\FixturePhp74; | ||
|
||
use Rector\Tests\Naming\Rector\Class_\RenamePropertyToMatchTypeRector\Source\EliteManager; | ||
|
||
class SomeClass | ||
{ | ||
/** | ||
* @var EliteManager | ||
*/ | ||
private $eventManager1; | ||
|
||
/** | ||
* @var EliteManager | ||
*/ | ||
private $eventManager2; | ||
|
||
public function __construct(EliteManager $eventManager1, EliteManager $eventManager2) | ||
{ | ||
$this->eventManager1 = $eventManager1; | ||
$this->eventManager2 = $eventManager2; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...or/Class_/RenamePropertyToMatchTypeRector/FixturePhp80/skip_change_duplicate_type.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,32 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Naming\Rector\Class_\RenamePropertyToMatchTypeRector\FixturePhp80; | ||
|
||
use PhpParser\Node; | ||
use PhpParser\Node\Identifier; | ||
use PhpParser\Node\Name; | ||
|
||
final class NameAndParent | ||
{ | ||
/** | ||
* @param Name|Identifier $nameNode | ||
*/ | ||
public function __construct( | ||
private Node $nameNode, | ||
private Node $parentNode | ||
) { | ||
} | ||
|
||
/** | ||
* @return Name|Identifier | ||
*/ | ||
public function getNameNode(): Node | ||
{ | ||
return $this->nameNode; | ||
} | ||
|
||
public function getParentNode(): Node | ||
{ | ||
return $this->parentNode; | ||
} | ||
} |
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