src/Reflection/ReflectionParameter.php
public function getClass() : ?ReflectionClass
    {
        $className = $this->getClassName();

        if ($className === null) {
            return null;
        }

        if (! $this->reflector instanceof ClassReflector) {
            throw new RuntimeException(sprintf(
                'Unable to reflect class type because we were not given a "%s", but a "%s" instead',
                ClassReflector::class,
                get_class($this->reflector)
            ));
        }

        return $this->reflector->reflect($className);
    }
public function getClass() : ?ReflectionClass
    {
        $className = $this->getClassName();

        if ($className === null) {
            return null;
        }

        if (! $this->reflector instanceof ClassReflector) {
            throw new RuntimeException(sprintf(
                'Unable to reflect class type because we were not given a "%s", but a "%s" instead',
                ClassReflector::class,
                get_class($this->reflector)
            ));
        }

        return $this->reflector->reflect($className);
    }
Gets a ReflectionClass for the type hint (returns null if not a class)

@throws RuntimeException