diff --git a/src/Rector/MethodCall/RenameMethodCallRector.php b/src/Rector/MethodCall/RenameMethodCallRector.php index 404727c331f..89a580e93d6 100644 --- a/src/Rector/MethodCall/RenameMethodCallRector.php +++ b/src/Rector/MethodCall/RenameMethodCallRector.php @@ -6,9 +6,7 @@ use PhpParser\BuilderHelpers; use PhpParser\Node; use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\MethodCall; -use PhpParser\Node\Expr\StaticCall; use PhpParser\Node\Identifier; -use PhpParser\Node\Stmt\ClassMethod; use Rector\Rector\AbstractRector; use Rector\RectorDefinition\ConfiguredCodeSample; use Rector\RectorDefinition\RectorDefinition; diff --git a/tests/Rector/MethodCall/RenameMethodCallRector/Fixture/fixture4.php.inc b/tests/Rector/MethodCall/RenameMethodCallRector/Fixture/fixture4.php.inc index ad7797ca92d..2e13a9e63a2 100644 --- a/tests/Rector/MethodCall/RenameMethodCallRector/Fixture/fixture4.php.inc +++ b/tests/Rector/MethodCall/RenameMethodCallRector/Fixture/fixture4.php.inc @@ -2,13 +2,32 @@ namespace Rector\Tests\Rector\MethodCall\RenameMethodCallRector\Fixture; -use Nette\Utils\Html; +use Rector\Tests\Rector\MethodCall\RenameMethodCallRector\Source\ClassMethodToBeSkipped; -class SomeClass5 +class ChildOfClassMethodToBeSkipped extends ClassMethodToBeSkipped { private function createHtml() { + $self = new ClassMethodToBeSkipped(); + $self->createHtml(); } } -?> \ No newline at end of file +?> +----- +testHtml(); + } +} + +?> diff --git a/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php b/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php index 435f9107005..fa6839bcf53 100644 --- a/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php +++ b/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php @@ -5,7 +5,7 @@ namespace Rector\Tests\Rector\MethodCall\RenameMethodCallRector; use Nette\Utils\Html; use Rector\Rector\MethodCall\RenameMethodCallRector; use Rector\Testing\PHPUnit\AbstractRectorTestCase; -use Rector\Tests\Rector\MethodCall\RenameMethodCallRector\Fixture\SomeClass5; +use Rector\Tests\Rector\MethodCall\RenameMethodCallRector\Source\ClassMethodToBeSkipped; final class RenameMethodCallRectorTest extends AbstractRectorTestCase { @@ -37,9 +37,9 @@ final class RenameMethodCallRectorTest extends AbstractRectorTestCase 'array_key' => 'hi', ], ], - SomeClass5::class => [ - 'createHtml' => 'testHtml' - ] + ClassMethodToBeSkipped::class => [ + 'createHtml' => 'testHtml', + ], ]; } } diff --git a/tests/Rector/MethodCall/RenameMethodCallRector/Source/ClassMethodToBeSkipped.php b/tests/Rector/MethodCall/RenameMethodCallRector/Source/ClassMethodToBeSkipped.php new file mode 100644 index 00000000000..5be11ffc9fc --- /dev/null +++ b/tests/Rector/MethodCall/RenameMethodCallRector/Source/ClassMethodToBeSkipped.php @@ -0,0 +1,8 @@ +