public function enterNode(Node $node)
{
switch (true) {
case $node instanceof Node\Stmt\Namespace_:
$this->namespace = (string) $node->name;
break;
case $node instanceof Node\Stmt\Class_:
$this->class = $node->name;
break;
case $node instanceof Node\Stmt\Trait_:
$this->trait = $node->name;
break;
case $node instanceof Node\Stmt\Function_:
$signature = $this->getFunctionNodeSignature($node);
$this->foundFunctionNode($this->getLocatedFunctionNode($node, $signature));
$this->function = $node->name;
break;
case $node instanceof Node\Stmt\ClassMethod:
$signature = $this->getMethodNodeSignature($node);
$this->foundFunctionNode($this->getLocatedFunctionNode($node, $signature));
$this->function = $node->name;
break;
case $node instanceof Node\Expr\Closure:
$signature = $this->getClosureNodeSignature($node);
$this->foundFunctionNode($this->getLocatedFunctionNode($node, $signature));
$this->closureNestingLevel++;
break;
default:
break;
}
}