@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | $mediasForm = $form->get('medias')->all(); |
| 42 | 42 | $mediasLocales = array_keys($mediasForm); |
| 43 | - $mediasRequiredLocales = array_keys(array_filter($mediasForm, function ($form) { |
|
| 43 | + $mediasRequiredLocales = array_keys(array_filter($mediasForm, function($form) { |
|
| 44 | 44 | return $form->isRequired(); |
| 45 | 45 | })); |
| 46 | 46 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | $translationsForm = $form->get('translations')->all(); |
| 39 | 39 | $translationsLocales = array_keys($translationsForm); |
| 40 | - $translationsRequiredLocales = array_keys(array_filter($translationsForm, function ($form) { |
|
| 40 | + $translationsRequiredLocales = array_keys(array_filter($translationsForm, function($form) { |
|
| 41 | 41 | return $form->isRequired(); |
| 42 | 42 | })); |
| 43 | 43 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ->arrayNode('locales') |
| 38 | 38 | ->beforeNormalization() |
| 39 | 39 | ->ifString() |
| 40 | - ->then(function ($v) { |
|
| 40 | + ->then(function($v) { |
|
| 41 | 41 | return preg_split('/\s*,\s*/', $v); |
| 42 | 42 | }) |
| 43 | 43 | ->end() |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ->arrayNode('required_locales') |
| 49 | 49 | ->beforeNormalization() |
| 50 | 50 | ->ifString() |
| 51 | - ->then(function ($v) { |
|
| 51 | + ->then(function($v) { |
|
| 52 | 52 | return preg_split('/\s*,\s*/', $v); |
| 53 | 53 | }) |
| 54 | 54 | ->end() |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | $container->setParameter('a2lix_translation_form.locale_provider', $config['locale_provider']); |
| 33 | 33 | $container->setParameter('a2lix_translation_form.locales', $config['locales']); |
| 34 | 34 | $container->setParameter('a2lix_translation_form.required_locales', $config['required_locales']); |
| 35 | - $container->setParameter('a2lix_translation_form.default_locale', $config['default_locale'] ?: |
|
| 36 | - $container->getParameter('kernel.default_locale')); |
|
| 35 | + $container->setParameter('a2lix_translation_form.default_locale', $config['default_locale'] ?: $container->getParameter('kernel.default_locale')); |
|
| 37 | 36 | |
| 38 | 37 | $container->setParameter('a2lix_translation_form.templating', $config['templating']); |
| 39 | 38 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | { |
| 51 | 51 | $resolver->setDefaults([ |
| 52 | 52 | 'by_reference' => false, |
| 53 | - 'empty_data' => function (FormInterface $form) { |
|
| 53 | + 'empty_data' => function(FormInterface $form) { |
|
| 54 | 54 | return new ArrayCollection(); |
| 55 | 55 | }, |
| 56 | 56 | 'locales' => $this->localeProvider->getLocales(), |
@@ -34,12 +34,12 @@ |
||
| 34 | 34 | { |
| 35 | 35 | $resolver->setDefaults([ |
| 36 | 36 | 'translation_path' => 'translations', |
| 37 | - 'query_builder' => function (EntityRepository $er) { |
|
| 37 | + 'query_builder' => function(EntityRepository $er) { |
|
| 38 | 38 | return $er->createQueryBuilder('e') |
| 39 | 39 | ->select('e, t') |
| 40 | 40 | ->join('e.translations', 't'); |
| 41 | 41 | }, |
| 42 | - 'choice_label' => function (Options $options) { |
|
| 42 | + 'choice_label' => function(Options $options) { |
|
| 43 | 43 | if (null === ($request = $this->requestStack->getCurrentRequest())) { |
| 44 | 44 | throw new \RuntimeException('Error while getting request'); |
| 45 | 45 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $resolver->setDefaults([ |
| 54 | 54 | 'by_reference' => false, |
| 55 | - 'empty_data' => function (FormInterface $form) { |
|
| 55 | + 'empty_data' => function(FormInterface $form) { |
|
| 56 | 56 | return new ArrayCollection(); |
| 57 | 57 | }, |
| 58 | 58 | 'locales' => $this->localeProvider->getLocales(), |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $resolver->setRequired('form_type'); |
| 65 | 65 | |
| 66 | - $resolver->setNormalizer('form_options', function (Options $options, $value): array { |
|
| 66 | + $resolver->setNormalizer('form_options', function(Options $options, $value): array { |
|
| 67 | 67 | // Check mandatory data_class option when AutoFormType use |
| 68 | 68 | if (($options['form_type'] instanceof AutoFormType) && !isset($value['data_class'])) { |
| 69 | 69 | throw new \RuntimeException(sprintf('Missing "data_class" option under "form_options" of TranslationsFormsType. Required when "form_type" use "AutoFormType".')); |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | $translationsForm = $form->get('translations')->all(); |
| 39 | 39 | $translationsLocales = array_keys($translationsForm); |
| 40 | - $translationsRequiredLocales = array_keys(array_filter($translationsForm, function ($form) { |
|
| 40 | + $translationsRequiredLocales = array_keys(array_filter($translationsForm, function($form) { |
|
| 41 | 41 | return $form->isRequired(); |
| 42 | 42 | })); |
| 43 | 43 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | $mediasForm = $form->get('medias')->all(); |
| 42 | 42 | $mediasLocales = array_keys($mediasForm); |
| 43 | - $mediasRequiredLocales = array_keys(array_filter($mediasForm, function ($form) { |
|
| 43 | + $mediasRequiredLocales = array_keys(array_filter($mediasForm, function($form) { |
|
| 44 | 44 | return $form->isRequired(); |
| 45 | 45 | })); |
| 46 | 46 | |