This commit is contained in:
Robin Krahnen 2020-03-10 14:35:24 +01:00
parent 5f77512296
commit 2bbebd9419
2 changed files with 5 additions and 7 deletions

View file

@ -31,7 +31,9 @@ class Package extends BasePackage
parent::boot($bootstrap);
$dispatcher = $bootstrap->getSignalSlotDispatcher();
$dispatcher->connect(ConfigurationManager::class, 'configurationManagerReady',
$dispatcher->connect(
ConfigurationManager::class,
'configurationManagerReady',
function (ConfigurationManager $configurationManager) {
$configurationManager->registerConfigurationType(
static::CONFIGURATION_TYPE_VALIDATION,

View file

@ -168,9 +168,7 @@ class SettingsValidator extends AbstractValidator
*/
protected function doesValidationGroupsMatch(array &$validatorConfig)
{
if (isset($validatorConfig['options']['validationGroups'])
&& empty(array_intersect($validatorConfig['options']['validationGroups'], $this->options['validationGroups']))
) {
if (isset($validatorConfig['options']['validationGroups']) && empty(array_intersect($validatorConfig['options']['validationGroups'], $this->options['validationGroups']))) {
return false;
}
@ -184,9 +182,7 @@ class SettingsValidator extends AbstractValidator
*/
protected function handleValidationGroups(array &$validatorConfig)
{
if (isset($validatorConfig['options']['validationGroups'])
&& $validatorConfig['validator'] !== 'DigiComp.SettingValidator:Settings'
) {
if (isset($validatorConfig['options']['validationGroups']) && $validatorConfig['validator'] !== 'DigiComp.SettingValidator:Settings') {
unset($validatorConfig['options']['validationGroups']);
} elseif ($validatorConfig['validator'] === 'DigiComp.SettingValidator:Settings') {
$validatorConfig['options']['validationGroups'] = $this->options['validationGroups'];