mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
drop unsued code [skip ci]
This commit is contained in:
parent
d5fc51f559
commit
c5b52323d9
@ -61,7 +61,17 @@ final class GetterToPropertyRector extends AbstractRector
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->isContainerGetCall($node);
|
||||
// finds **$this->get**('string')
|
||||
if ($node->var->name !== 'this' || (string) $node->name !== 'get') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// finds $this->get(**'string'**)
|
||||
if (count($node->args) !== 1 || ! $node->args[0]->value instanceof String_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,22 +92,6 @@ final class GetterToPropertyRector extends AbstractRector
|
||||
return 3.3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is "$this->get('string')" statements?
|
||||
*/
|
||||
private function isContainerGetCall(MethodCall $methodCall): bool
|
||||
{
|
||||
if ($methodCall->var->name !== 'this' || (string) $methodCall->name !== 'get') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (count($methodCall->args) !== 1 || ! $methodCall->args[0]->value instanceof String_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function processMethodCallNode(MethodCall $methodCall): ?PropertyFetch
|
||||
{
|
||||
$serviceType = $this->serviceFromKernelResolver->resolveServiceClassFromArgument(
|
||||
|
Loading…
x
Reference in New Issue
Block a user