public function getParentClass() : ?ReflectionClass
    {
        if (! ($this->node instanceof ClassNode) || $this->node->extends === null) {
            return null;
        }

        // @TODO use actual `ClassReflector` or `FunctionReflector`?
        /** @var self $parent */
        $parent = $this->reflector->reflect($this->node->extends->toString());

        if ($parent->isInterface() || $parent->isTrait()) {
            throw NotAClassReflection::fromReflectionClass($parent);
        }

        return $parent;
    }