| @@ -59,16 +59,16 @@ | ||
| 59 | 59 | |
| 60 | 60 | $productTranslationEn = new ProductTranslation(); | 
| 61 | 61 |          $productTranslationEn->setLocale('en') | 
| 62 | -                             ->setTitle('title en') | |
| 63 | -                             ->setDescription('desc en'); | |
| 62 | +                                ->setTitle('title en') | |
| 63 | +                                ->setDescription('desc en'); | |
| 64 | 64 | $productTranslationFr = new ProductTranslation(); | 
| 65 | 65 |          $productTranslationFr->setLocale('fr') | 
| 66 | -                             ->setTitle('title fr') | |
| 67 | -                             ->setDescription('desc fr'); | |
| 66 | +                                ->setTitle('title fr') | |
| 67 | +                                ->setDescription('desc fr'); | |
| 68 | 68 | $productTranslationDe = new ProductTranslation(); | 
| 69 | 69 |          $productTranslationDe->setLocale('de') | 
| 70 | -                             ->setTitle('title de') | |
| 71 | -                             ->setDescription('desc de'); | |
| 70 | +                                ->setTitle('title de') | |
| 71 | +                                ->setDescription('desc de'); | |
| 72 | 72 | |
| 73 | 73 | $product = new Product(); | 
| 74 | 74 |          $product->setUrl('a2lix.fr') | 
| @@ -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 | |
| @@ -42,8 +42,8 @@ discard block | ||
| 42 | 42 | parent::setUp(); | 
| 43 | 43 | |
| 44 | 44 | $validator = $this->getMockBuilder(ValidatorInterface::class) | 
| 45 | - ->disableOriginalConstructor() | |
| 46 | - ->getMock(); | |
| 45 | + ->disableOriginalConstructor() | |
| 46 | + ->getMock(); | |
| 47 | 47 |          $validator->method('validate')->will($this->returnValue(new ConstraintViolationList())); | 
| 48 | 48 | |
| 49 | 49 | $this->factory = Forms::createFormFactoryBuilder() | 
| @@ -53,8 +53,8 @@ discard block | ||
| 53 | 53 | ) | 
| 54 | 54 | ->addTypeGuesser( | 
| 55 | 55 | $this->getMockBuilder(ValidatorTypeGuesser::class) | 
| 56 | - ->disableOriginalConstructor() | |
| 57 | - ->getMock() | |
| 56 | + ->disableOriginalConstructor() | |
| 57 | + ->getMock() | |
| 58 | 58 | ) | 
| 59 | 59 | ->getFormFactory(); | 
| 60 | 60 | |
| @@ -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 @@ 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 | |