@@ -40,11 +40,11 @@ |
||
| 40 | 40 | public function buildForm(FormBuilderInterface $builder, array $options) : void |
| 41 | 41 | { |
| 42 | 42 | $session_key = md5($builder->getForm()->getName() . '_session_key'); |
| 43 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($session_key) { |
|
| 43 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($session_key) { |
|
| 44 | 44 | $value = $event->getForm()->getData(); |
| 45 | 45 | $session = new midcom_services_session('midcom_datamanager_captcha'); |
| 46 | 46 | |
| 47 | - if ( !$session->exists($session_key) |
|
| 47 | + if (!$session->exists($session_key) |
|
| 48 | 48 | || $value != $session->get($session_key)) { |
| 49 | 49 | $event->getForm()->addError(new FormError($this->l10n->get('captcha validation failed'))); |
| 50 | 50 | } |
@@ -36,11 +36,11 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function configureOptions(OptionsResolver $resolver) : void |
| 38 | 38 | { |
| 39 | - $resolver->setDefault('config', function (Options $options) { |
|
| 39 | + $resolver->setDefault('config', function(Options $options) { |
|
| 40 | 40 | return \midcom_baseclasses_components_configuration::get('midcom.datamanager', 'config'); |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
| 43 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
| 44 | 44 | $widget_defaults = [ |
| 45 | 45 | 'height' => 25, |
| 46 | 46 | 'width' => 80, |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function configureOptions(OptionsResolver $resolver) : void |
| 34 | 34 | { |
| 35 | 35 | $resolver->setDefault('error_bubbling', false); |
| 36 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
| 36 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
| 37 | 37 | $widget_defaults = [ |
| 38 | 38 | 'creation_mode_enabled' => false, |
| 39 | 39 | 'class' => null, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | return helper::normalize($widget_defaults, $value); |
| 68 | 68 | }); |
| 69 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
| 69 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
| 70 | 70 | $type_defaults = [ |
| 71 | 71 | 'options' => [], |
| 72 | 72 | 'method' => 'GET', |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | public function finishView(FormView $view, FormInterface $form, array $options) : void |
| 109 | 109 | { |
| 110 | 110 | $preset = []; |
| 111 | - if ( !empty($view->children['selection']->vars['data']) |
|
| 111 | + if (!empty($view->children['selection']->vars['data']) |
|
| 112 | 112 | && !empty($options['widget_config']['class'])) { |
| 113 | 113 | foreach (array_filter((array) $view->children['selection']->vars['data']) as $identifier) { |
| 114 | 114 | if ($options['widget_config']['id_field'] == 'id') { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function configureOptions(OptionsResolver $resolver) : void |
| 24 | 24 | { |
| 25 | - $resolver->setNormalizer('write_privilege', function (Options $options, $value) { |
|
| 25 | + $resolver->setNormalizer('write_privilege', function(Options $options, $value) { |
|
| 26 | 26 | return (array) $value + ['privilege' => 'midcom:urlname']; |
| 27 | 27 | }); |
| 28 | 28 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | ] |
| 37 | 37 | ]); |
| 38 | 38 | |
| 39 | - $resolver->setNormalizer('constraints', function (Options $options, $value) { |
|
| 39 | + $resolver->setNormalizer('constraints', function(Options $options, $value) { |
|
| 40 | 40 | $validator_options = [ |
| 41 | 41 | 'allow_catenate' => $options['type_config']['allow_catenate'], |
| 42 | 42 | 'allow_unclean' => $options['type_config']['allow_unclean'], |
@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function configureOptions(OptionsResolver $resolver) : void |
| 28 | 28 | { |
| 29 | - $choice_loader = function (Options $options) { |
|
| 29 | + $choice_loader = function(Options $options) { |
|
| 30 | 30 | if (!empty($options['choices'])) { |
| 31 | 31 | return null; |
| 32 | 32 | } |
| 33 | 33 | return new loader($options['type_config']); |
| 34 | 34 | }; |
| 35 | 35 | |
| 36 | - $map_multiple = function (Options $options) { |
|
| 36 | + $map_multiple = function(Options $options) { |
|
| 37 | 37 | return !empty($options['type_config']['allow_multiple']); |
| 38 | 38 | }; |
| 39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | 'placeholder' => false |
| 44 | 44 | ]); |
| 45 | 45 | |
| 46 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
| 46 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
| 47 | 47 | $type_defaults = [ |
| 48 | 48 | 'options' => [], |
| 49 | 49 | 'option_callback' => null, |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function configureOptions(OptionsResolver $resolver) : void |
| 26 | 26 | { |
| 27 | 27 | $resolver->setDefault('error_bubbling', false); |
| 28 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
| 28 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
| 29 | 29 | $type_defaults = [ |
| 30 | 30 | 'options' => [], |
| 31 | 31 | 'allow_other' => true, |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function configureOptions(OptionsResolver $resolver) : void |
| 26 | 26 | { |
| 27 | - $map_attr = function (Options $options, $value) { |
|
| 27 | + $map_attr = function(Options $options, $value) { |
|
| 28 | 28 | $value ??= []; |
| 29 | 29 | $value['class'] = $options['widget_config']['enabled'] ? 'codemirror ' . $options['widget_config']['language'] : 'longtext'; |
| 30 | 30 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | ] |
| 45 | 45 | ]); |
| 46 | 46 | |
| 47 | - $resolver->setNormalizer('constraints', function (Options $options, $value) { |
|
| 47 | + $resolver->setNormalizer('constraints', function(Options $options, $value) { |
|
| 48 | 48 | if ($options['dm2_type'] == 'php') { |
| 49 | 49 | $value[] = new php; |
| 50 | 50 | } |