simplify function handleValidationGroups

This commit is contained in:
Robin Krahnen 2020-05-04 22:02:12 +02:00
parent 08e6ad00d4
commit 743ec61c44

View file

@ -172,10 +172,10 @@ class SettingsValidator extends AbstractValidator
*/ */
protected function handleValidationGroups(array &$validatorConfig) protected function handleValidationGroups(array &$validatorConfig)
{ {
if (isset($validatorConfig['options']['validationGroups']) && $validatorConfig['validator'] !== 'DigiComp.SettingValidator:Settings') { if ($validatorConfig['validator'] === 'DigiComp.SettingValidator:Settings') {
unset($validatorConfig['options']['validationGroups']);
} elseif ($validatorConfig['validator'] === 'DigiComp.SettingValidator:Settings') {
$validatorConfig['options']['validationGroups'] = $this->options['validationGroups']; $validatorConfig['options']['validationGroups'] = $this->options['validationGroups'];
} elseif (isset($validatorConfig['options']['validationGroups'])) {
unset($validatorConfig['options']['validationGroups']);
} }
} }
} }