protected function newValidator(ResourceConfiguration $config)
    {
        $class = $config->getValidatorClass();

        return $config->isUsingYamlValidation() ?
            new YamlResourceValidator($config->getYamlValidation()) : new $class();
    }