mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-06 03:10:50 +00:00
remove unused helper method
This commit is contained in:
parent
94daf88807
commit
deaaa019ad
|
@ -137,24 +137,16 @@ final class NamedServicesToConstructorNodeVisitor extends NodeVisitorAbstract
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param MethodCall|Expr $methodCallNode
|
|
||||||
*/
|
|
||||||
private function resolveServiceTypeFromMethodCall($methodCallNode): ?string
|
|
||||||
{
|
|
||||||
/** @var String_ $argument */
|
|
||||||
$argument = $methodCallNode->args[0]->value;
|
|
||||||
$serviceName = $argument->value;
|
|
||||||
|
|
||||||
return $this->serviceFromKernelResolver->resolveServiceClassByNameFromKernel(
|
|
||||||
$serviceName, LocalKernel::class
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function processMethodCallNode(Class_ $classNode, MethodCall $methodCall): ?PropertyFetch
|
private function processMethodCallNode(Class_ $classNode, MethodCall $methodCall): ?PropertyFetch
|
||||||
{
|
{
|
||||||
// Get service type
|
/** @var String_ $argument */
|
||||||
$serviceType = $this->resolveServiceTypeFromMethodCall($methodCall);
|
$argument = $methodCall->args[0]->value;
|
||||||
|
$serviceName = $argument->value;
|
||||||
|
|
||||||
|
$serviceType = $this->serviceFromKernelResolver->resolveServiceClassByNameFromKernel(
|
||||||
|
$serviceName, LocalKernel::class
|
||||||
|
);
|
||||||
|
|
||||||
if ($serviceType === null) {
|
if ($serviceType === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,27 +124,15 @@ final class GetterToPropertyNodeVisitor extends NodeVisitorAbstract
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param MethodCall|Expr $methodCallNode
|
|
||||||
*/
|
|
||||||
private function resolveServiceTypeFromMethodCall($methodCallNode): ?string
|
|
||||||
{
|
|
||||||
/** @var String_ $argument */
|
|
||||||
$argument = $methodCallNode->args[0]->value;
|
|
||||||
$serviceName = $argument->value;
|
|
||||||
|
|
||||||
return $this->serviceFromKernelResolver->resolveServiceClassByNameFromKernel(
|
|
||||||
$serviceName, LocalKernel::class
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function processMethodCallNode(MethodCall $methodCall): ?PropertyFetch
|
private function processMethodCallNode(MethodCall $methodCall): ?PropertyFetch
|
||||||
{
|
{
|
||||||
// Get service type
|
/** @var String_ $argument */
|
||||||
$serviceType = $this->resolveServiceTypeFromMethodCall($methodCall);
|
$argument = $methodCall->args[0]->value;
|
||||||
if ($serviceType === null) {
|
$serviceName = $argument->value;
|
||||||
return null;
|
|
||||||
}
|
$serviceType = $this->serviceFromKernelResolver->resolveServiceClassByNameFromKernel(
|
||||||
|
$serviceName, LocalKernel::class
|
||||||
|
);
|
||||||
|
|
||||||
// Get property name
|
// Get property name
|
||||||
$propertyName = $this->nameResolver->resolvePropertyNameFromType($serviceType);
|
$propertyName = $this->nameResolver->resolvePropertyNameFromType($serviceType);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user