private static function isVariableDeclaration(Node $n, string $name)
    {
        if (
            // TODO - clean this up
            ($n instanceof Node\Expression\AssignmentExpression && $n->operator->kind === PhpParser\TokenKind::EqualsToken)
            && $n->leftOperand instanceof Node\Expression\Variable && $n->leftOperand->getName() === $name
        ) {
            return true;
        }

        if (
            ($n instanceof Node\ForeachValue || $n instanceof Node\ForeachKey)
            && $n->expression instanceof Node\Expression\Variable
            && $n->expression->getName() === $name
        ) {
            return true;
        }

        return false;
    }