-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Renaming] Skip renaming method call on RenameMethodRector when both …
…old and new exists, which implements interface as config (#2276) * [Renaming] Skip renaming method call on RenameMethodRector when both old and new exists * rollback fixture * verify if caller is a class that implements interface, which both old and new method exists * [ci-review] Rector Rectify * clean up * allow directly get ClassReflection from StaticCall/MethodCall from ReflectionResolver * clean up * [ci-review] Rector Rectify * [ci-review] Rector Rectify * [ci-review] Rector Rectify * verify that classlike is different, it means it is a child * final touch: comment Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
1dd739a
commit ebd4c3f
Showing
6 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...tor/MethodCall/RenameMethodRector/Fixture/skip_old_new_exists_implement_interface.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,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Renaming\Rector\MethodCall\RenameMethodRector\Fixture; | ||
|
||
use Nette\Utils\Html; | ||
use Rector\Tests\Renaming\Rector\MethodCall\RenameMethodRector\Source\AClass; | ||
|
||
class SkipOldNewExistsImplementsInterface | ||
{ | ||
public function run(AClass $aClass) | ||
{ | ||
$aClass->some_old(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
rules-tests/Renaming/Rector/MethodCall/RenameMethodRector/Source/AClass.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,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Renaming\Rector\MethodCall\RenameMethodRector\Source; | ||
|
||
final class AClass implements NewInterface | ||
{ | ||
public function some_old() | ||
{ | ||
} | ||
|
||
public function some_new() | ||
{ | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
rules-tests/Renaming/Rector/MethodCall/RenameMethodRector/Source/NewInterface.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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Renaming\Rector\MethodCall\RenameMethodRector\Source; | ||
|
||
interface NewInterface | ||
{ | ||
public function some_new(); | ||
} |
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
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
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