final protected function getClassForType($type)
    {
        if (!class_exists($type)) {
            throw new ValidatorDoesNotExistException("Validator class {$type} does not exist");
        }
        $validator = new $type;
        if (! ($validator instanceof ValidatorInterface)) {
            throw new ValidatorDoesNotExistException(
                "Validator class {$type} must implement " . ValidatorInterface::class
            );
        }

        return $validator;
    }