@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | ->arrayNode('locales') |
| 36 | 36 | ->beforeNormalization() |
| 37 | 37 | ->ifString() |
| 38 | - ->then(function ($v) { return preg_split('/\s*,\s*/', $v); }) |
|
| 38 | + ->then(function($v) { return preg_split('/\s*,\s*/', $v); }) |
|
| 39 | 39 | ->end() |
| 40 | 40 | ->requiresAtLeastOneElement() |
| 41 | 41 | ->prototype('scalar')->end() |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ->arrayNode('required_locales') |
| 44 | 44 | ->beforeNormalization() |
| 45 | 45 | ->ifString() |
| 46 | - ->then(function ($v) { return preg_split('/\s*,\s*/', $v); }) |
|
| 46 | + ->then(function($v) { return preg_split('/\s*,\s*/', $v); }) |
|
| 47 | 47 | ->end() |
| 48 | 48 | ->prototype('scalar')->end() |
| 49 | 49 | ->end() |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | $container->setParameter('a2lix_translation_form.locale_provider', $config['locale_provider']); |
| 41 | 41 | $container->setParameter('a2lix_translation_form.locales', $config['locales']); |
| 42 | 42 | $container->setParameter('a2lix_translation_form.required_locales', $config['required_locales']); |
| 43 | - $container->setParameter('a2lix_translation_form.default_locale', $config['default_locale'] ?: |
|
| 44 | - $container->getParameter('kernel.default_locale')); |
|
| 43 | + $container->setParameter('a2lix_translation_form.default_locale', $config['default_locale'] ?: $container->getParameter('kernel.default_locale')); |
|
| 45 | 44 | |
| 46 | 45 | $container->setParameter('a2lix_translation_form.templating', $config['templating']); |
| 47 | 46 | |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | $resolver->setDefaults([ |
| 55 | 55 | 'translation_path' => 'translations', |
| 56 | 56 | 'translation_property' => null, |
| 57 | - 'query_builder' => function (EntityRepository $er) { |
|
| 57 | + 'query_builder' => function(EntityRepository $er) { |
|
| 58 | 58 | return $er->createQueryBuilder('e') |
| 59 | 59 | ->select('e, t') |
| 60 | 60 | ->join('e.translations', 't'); |
| 61 | 61 | }, |
| 62 | - $optionProperty => function (Options $options) { |
|
| 62 | + $optionProperty => function(Options $options) { |
|
| 63 | 63 | return $options['translation_path'].'['.$this->getLocale().'].'.$options['translation_property']; |
| 64 | 64 | }, |
| 65 | 65 | ]); |
@@ -75,8 +75,7 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | return |
| 77 | 77 | method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix') ? |
| 78 | - 'Symfony\Bridge\Doctrine\Form\Type\EntityType' : |
|
| 79 | - 'entity'; |
|
| 78 | + 'Symfony\Bridge\Doctrine\Form\Type\EntityType' : 'entity'; |
|
| 80 | 79 | } |
| 81 | 80 | |
| 82 | 81 | // BC for SF < 3.0 |
@@ -69,8 +69,7 @@ |
||
| 69 | 69 | { |
| 70 | 70 | return |
| 71 | 71 | method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix') ? |
| 72 | - 'Symfony\Component\Form\Extension\Core\Type\ChoiceType' : |
|
| 73 | - 'choice'; |
|
| 72 | + 'Symfony\Component\Form\Extension\Core\Type\ChoiceType' : 'choice'; |
|
| 74 | 73 | } |
| 75 | 74 | |
| 76 | 75 | // BC for SF < 3.0 |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | { |
| 69 | 69 | $resolver->setDefaults([ |
| 70 | 70 | 'by_reference' => false, |
| 71 | - 'empty_data' => function (FormInterface $form) { |
|
| 71 | + 'empty_data' => function(FormInterface $form) { |
|
| 72 | 72 | return new \Doctrine\Common\Collections\ArrayCollection(); |
| 73 | 73 | }, |
| 74 | 74 | 'locales' => $this->localeProvider->getLocales(), |
@@ -49,16 +49,16 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $productTranslationFr = new ProductTranslation(); |
| 51 | 51 | $productTranslationFr->setLocale('fr') |
| 52 | - ->setTitle('title fr') |
|
| 53 | - ->setDescription('desc fr'); |
|
| 52 | + ->setTitle('title fr') |
|
| 53 | + ->setDescription('desc fr'); |
|
| 54 | 54 | $productTranslationEn = new ProductTranslation(); |
| 55 | 55 | $productTranslationEn->setLocale('en') |
| 56 | - ->setTitle('title en') |
|
| 57 | - ->setDescription('desc en'); |
|
| 56 | + ->setTitle('title en') |
|
| 57 | + ->setDescription('desc en'); |
|
| 58 | 58 | $productTranslationDe = new ProductTranslation(); |
| 59 | 59 | $productTranslationDe->setLocale('de') |
| 60 | - ->setTitle('title de') |
|
| 61 | - ->setDescription('desc de'); |
|
| 60 | + ->setTitle('title de') |
|
| 61 | + ->setDescription('desc de'); |
|
| 62 | 62 | |
| 63 | 63 | $product = new Product(); |
| 64 | 64 | $product->setUrl('a2lix.fr') |
@@ -141,12 +141,12 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $productTranslationEs = new ProductTranslation(); |
| 143 | 143 | $productTranslationEs->setLocale('es') |
| 144 | - ->setTitle('title es') |
|
| 145 | - ->setDescription('desc es'); |
|
| 144 | + ->setTitle('title es') |
|
| 145 | + ->setDescription('desc es'); |
|
| 146 | 146 | $productTranslationFr = new ProductTranslation(); |
| 147 | 147 | $productTranslationFr->setLocale('fr') |
| 148 | - ->setTitle('title fr') |
|
| 149 | - ->setDescription('desc fr'); |
|
| 148 | + ->setTitle('title fr') |
|
| 149 | + ->setDescription('desc fr'); |
|
| 150 | 150 | |
| 151 | 151 | $product = new Product(); |
| 152 | 152 | $product->setUrl('a2lix.fr') |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | ]; |
| 191 | 191 | $productTranslationDe = new ProductTranslation(); |
| 192 | 192 | $productTranslationDe->setLocale('de') |
| 193 | - ->setTitle('title de') |
|
| 194 | - ->setDescription('desc de'); |
|
| 193 | + ->setTitle('title de') |
|
| 194 | + ->setDescription('desc de'); |
|
| 195 | 195 | $product->addTranslation($productTranslationDe); |
| 196 | 196 | |
| 197 | 197 | $form = $this->factory->createBuilder($formType, $product) |
@@ -236,13 +236,13 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | $productTranslationFr = new ProductTranslation(); |
| 238 | 238 | $productTranslationFr->setLocale('fr') |
| 239 | - ->setTitle('title fr'); |
|
| 239 | + ->setTitle('title fr'); |
|
| 240 | 240 | $productTranslationEn = new ProductTranslation(); |
| 241 | 241 | $productTranslationEn->setLocale('en') |
| 242 | - ->setTitle('title en'); |
|
| 242 | + ->setTitle('title en'); |
|
| 243 | 243 | $productTranslationDe = new ProductTranslation(); |
| 244 | 244 | $productTranslationDe->setLocale('de') |
| 245 | - ->setTitle('title de'); |
|
| 245 | + ->setTitle('title de'); |
|
| 246 | 246 | |
| 247 | 247 | $product = new Product(); |
| 248 | 248 | $product->setUrl('a2lix.fr') |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | { |
| 69 | 69 | $resolver->setDefaults([ |
| 70 | 70 | 'by_reference' => false, |
| 71 | - 'empty_data' => function (FormInterface $form) { |
|
| 71 | + 'empty_data' => function(FormInterface $form) { |
|
| 72 | 72 | return new \Doctrine\Common\Collections\ArrayCollection(); |
| 73 | 73 | }, |
| 74 | 74 | 'locales' => $this->localeProvider->getLocales(), |