From 743ec61c449453f547731203c30084b32eb35cbd Mon Sep 17 00:00:00 2001 From: Robin Krahnen Date: Mon, 4 May 2020 22:02:12 +0200 Subject: [PATCH] simplify function handleValidationGroups --- Classes/Validation/Validator/SettingsValidator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Validation/Validator/SettingsValidator.php b/Classes/Validation/Validator/SettingsValidator.php index 9b2b5c8..bba2457 100644 --- a/Classes/Validation/Validator/SettingsValidator.php +++ b/Classes/Validation/Validator/SettingsValidator.php @@ -172,10 +172,10 @@ class SettingsValidator extends AbstractValidator */ protected function handleValidationGroups(array &$validatorConfig) { - if (isset($validatorConfig['options']['validationGroups']) && $validatorConfig['validator'] !== 'DigiComp.SettingValidator:Settings') { - unset($validatorConfig['options']['validationGroups']); - } elseif ($validatorConfig['validator'] === 'DigiComp.SettingValidator:Settings') { + if ($validatorConfig['validator'] === 'DigiComp.SettingValidator:Settings') { $validatorConfig['options']['validationGroups'] = $this->options['validationGroups']; + } elseif (isset($validatorConfig['options']['validationGroups'])) { + unset($validatorConfig['options']['validationGroups']); } } }