PHPMD\Rule\UnusedLocalVariable::removeParameters PHP Method

removeParameters() private method

This method removes all variables from the $_images property that are also found in the formal parameters of the given method or/and function node.
private removeParameters ( PHPMD\Node\AbstractCallableNode $node ) : void
$node PHPMD\Node\AbstractCallableNode
return void
    private function removeParameters(AbstractCallableNode $node)
    {
        // Get formal parameter container
        $parameters = $node->getFirstChildOfType('FormalParameters');
        // Now get all declarators in the formal parameters container
        $declarators = $parameters->findChildrenOfType('VariableDeclarator');
        foreach ($declarators as $declarator) {
            unset($this->images[$declarator->getImage()]);
        }
    }