PHPMD\Rule\UnusedLocalVariable::collectLiteral PHP Method

collectLiteral() private method

Stores the given literal node in an internal list of found variables.
private collectLiteral ( PHPMD\Node\ASTNode $node ) : void
$node PHPMD\Node\ASTNode
return void
    private function collectLiteral(ASTNode $node)
    {
        $variable = '$' . trim($node->getImage(), '\'');
        if (!isset($this->images[$variable])) {
            $this->images[$variable] = array();
        }
        $this->images[$variable][] = $node;
    }