mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 08:50:50 +00:00
[Transform] Skip different method on CallableInMethodCallToVariableRector (#2395)
* [Transform] Skip different method on CallableInMethodCallToVariableRector
* [Transform] Skip different method on CallableInMethodCallToVariableRector
* [Transform] Skip different method on CallableInMethodCallToVariableRector
* Fixed 🎉
* cs
* fix code analysis dev
This commit is contained in:
parent
7df41da055
commit
0dc9777f46
6
.github/workflows/code_analysis_no_dev.yaml
vendored
6
.github/workflows/code_analysis_no_dev.yaml
vendored
|
@ -25,5 +25,7 @@ jobs:
|
|||
rm phpstan-for-rector.neon
|
||||
touch phpstan-for-rector.neon
|
||||
|
||||
- run: composer install --no-progress --ansi --no-dev
|
||||
- run: bin/rector list --ansi
|
||||
- run: |
|
||||
composer install --ansi
|
||||
composer install --no-progress --ansi --no-dev
|
||||
- run: bin/rector list --ansi
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Tests\Transform\Rector\MethodCall\CallableInMethodCallToVariableRector\Fixture;
|
||||
|
||||
use Rector\Tests\Transform\Rector\MethodCall\CallableInMethodCallToVariableRector\Source\DummyCache;
|
||||
|
||||
final class SkipDifferentMethod
|
||||
{
|
||||
public function run(DummyCache $dummyCache, $someValue)
|
||||
{
|
||||
$dummyCache->load('key', function ($someValue) {
|
||||
$someValue= $someValue + 1000;
|
||||
return $someValue + 10;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -86,6 +86,13 @@ CODE_SAMPLE
|
|||
continue;
|
||||
}
|
||||
|
||||
if (! $this->nodeNameResolver->isName(
|
||||
$node->name,
|
||||
$singleCallableInMethodCallToVariable->getMethodName()
|
||||
)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$position = $singleCallableInMethodCallToVariable->getArgumentPosition();
|
||||
if (! isset($node->args[$position])) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue
Block a user