mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
SymfonyContainerCallsAnalyzer fix
This commit is contained in:
parent
577ae7ff89
commit
a6fdc22465
@ -3,7 +3,9 @@
|
||||
namespace Rector\NodeAnalyzer;
|
||||
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
|
||||
final class SymfonyContainerCallsAnalyzer
|
||||
@ -17,13 +19,14 @@ final class SymfonyContainerCallsAnalyzer
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($methodCall->name instanceof Variable) {
|
||||
$methodName = $methodCall->name->name;
|
||||
} else {
|
||||
$methodName = (string) $methodCall->name;
|
||||
if (! $methodCall->name instanceof Identifier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($methodCall->var->name !== 'this' || $methodName !== 'get') {
|
||||
$variableName = $methodCall->var->name;
|
||||
$methodName = (string) $methodCall->name;
|
||||
|
||||
if ($variableName !== 'this' || $methodName !== 'get') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user