@@ -26,7 +26,8 @@ |
||
| 26 | 26 | private Throwable $error; |
| 27 | 27 | |
| 28 | 28 | public function __construct(private array $error_actions, private midcom_helper_style $style) |
| 29 | - {} |
|
| 29 | + { |
|
| 30 | +} |
|
| 30 | 31 | |
| 31 | 32 | public static function getSubscribedEvents() : array |
| 32 | 33 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | 'max_count' => 0 |
| 39 | 39 | ] |
| 40 | 40 | ]); |
| 41 | - $resolver->setNormalizer('constraints', function (Options $options, $value) { |
|
| 41 | + $resolver->setNormalizer('constraints', function(Options $options, $value) { |
|
| 42 | 42 | $min = $max = null; |
| 43 | 43 | if ($options['type_config']['max_count'] > 0) { |
| 44 | 44 | $max = $options['type_config']['max_count']; |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | return []; |
| 53 | 53 | }); |
| 54 | - $resolver->setNormalizer('entry_options', function (Options $options, $value) { |
|
| 54 | + $resolver->setNormalizer('entry_options', function(Options $options, $value) { |
|
| 55 | 55 | return array_replace([ |
| 56 | 56 | 'widget_config' => $options['widget_config'] |
| 57 | 57 | ], (array) $value); |
| 58 | 58 | }); |
| 59 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
| 59 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
| 60 | 60 | if (!array_key_exists('sortable', $value)) { |
| 61 | 61 | $value['sortable'] = false; |
| 62 | 62 | } |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function validate($value, Constraint $constraint) : void |
| 14 | 14 | { |
| 15 | - if ( empty($value) |
|
| 15 | + if (empty($value) |
|
| 16 | 16 | || !empty($value['delete']) |
| 17 | - || ( empty($value['file']) |
|
| 18 | - && ( (empty($constraint->config['do_not_save_archival']) && empty($value['archival'])) |
|
| 17 | + || (empty($value['file']) |
|
| 18 | + && ((empty($constraint->config['do_not_save_archival']) && empty($value['archival'])) |
|
| 19 | 19 | || (!empty($constraint->config['do_not_save_archival']) && empty($value['main']))))) { |
| 20 | 20 | $this->context->buildViolation('This value should not be blank.') |
| 21 | 21 | ->addViolation(); |