src/Reflection/ReflectionClass.php
private function reflectClassForNamedNode(Node\Name $node) : self
    {
        // @TODO use actual `ClassReflector` or `FunctionReflector`?
        if ($this->isAnonymous()) {
            /** @var self $class */
            $class = (new BetterReflection())->classReflector()->reflect($node->toString());
        } else {
            /** @var self $class */
            $class = $this->reflector->reflect($node->toString());
        }

        return $class;
    }
private function reflectClassForNamedNode(Node\Name $node) : self
    {
        // @TODO use actual `ClassReflector` or `FunctionReflector`?
        if ($this->isAnonymous()) {
            /** @var self $class */
            $class = (new BetterReflection())->classReflector()->reflect($node->toString());
        } else {
            /** @var self $class */
            $class = $this->reflector->reflect($node->toString());
        }

        return $class;
    }
Given an AST Node\Name, create a new ReflectionClass for the element.