'Return the ancestor Variable for this var.
For next example php code:
<? $a = \'ls\' . $_GET[\'bar\'];
$b = somefunc($a);
we got that $_GET is $a\'s ancestor as well as $a is for $b.'

def _get_ancestor_var(self, node):

    for n in NodeRep.parse(node):
        if (type(n) is phpast.Variable):
            nodetys = [phpast.FunctionCall]
            for fc in self._get_parent_nodes(n, nodetys=nodetys):
                vulnty = FuncCall.get_vulnty_for_sec(fc.name)
                if vulnty:
                    self._safe_for.append(vulnty)
            return n
    return None
