drop unsued code [skip ci]

This commit is contained in:
TomasVotruba 2017-09-02 15:42:04 +02:00
parent d5fc51f559
commit c5b52323d9

View File

@ -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(