@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | ->add('author', null, [ |
53 | 53 | 'label' => 'form.article.type.author.label', |
54 | 54 | 'required' => true, |
55 | - 'query_builder' => function (EntityRepository $er) { |
|
55 | + 'query_builder' => function(EntityRepository $er) { |
|
56 | 56 | return $er->createQueryBuilder('user') |
57 | 57 | ->where('user.roles LIKE :roles') |
58 | 58 | ->setParameter('roles', '%ROLE_VICTOIRE%'); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | ]) |
61 | 61 | ->remove('visibleOnFront'); |
62 | 62 | |
63 | - $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
63 | + $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
64 | 64 | $data = $event->getData(); |
65 | 65 | $parent = $event->getForm()->getParent(); |
66 | 66 | $this->manageCategories($data, $parent); |
@@ -68,19 +68,19 @@ discard block |
||
68 | 68 | $this->manageLocales($data, $parent); |
69 | 69 | }); |
70 | 70 | |
71 | - $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
71 | + $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
72 | 72 | $data = $event->getData(); |
73 | 73 | $parent = $event->getForm()->getParent(); |
74 | 74 | $this->manageCategories($data, $parent); |
75 | 75 | $this->manageLocales($data, $parent); |
76 | 76 | }); |
77 | 77 | |
78 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
78 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
79 | 79 | $data = $event->getData(); |
80 | 80 | $form = $event->getForm(); |
81 | 81 | $this->manageTags($data, $form); |
82 | 82 | }); |
83 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
83 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
84 | 84 | $form = $event->getForm(); |
85 | 85 | $data = $form->getData(); |
86 | 86 | $this->manageTags($data, $form); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $form->add('tags', TagsType::class, [ |
96 | 96 | 'required' => false, |
97 | 97 | 'multiple' => true, |
98 | - 'query_builder' => function (TagRepository $er) use ($data) { |
|
98 | + 'query_builder' => function(TagRepository $er) use ($data) { |
|
99 | 99 | $qb = $er->filterByBlog($data->getBlog())->getInstance(); |
100 | 100 | $er->clearInstance(); |
101 | 101 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | if (!$form->getData()->getTemplate()) { |
180 | 180 | if ($articleTemplateRepo->filterByBlog($blog_id)->getCount('parent')->run('getSingleScalarResult') > 1) { |
181 | - $articleTemplates = function (ArticleTemplateRepository $repo) use ($blog_id) { |
|
181 | + $articleTemplates = function(ArticleTemplateRepository $repo) use ($blog_id) { |
|
182 | 182 | return $repo->filterByBlog($blog_id)->getInstance(); |
183 | 183 | }; |
184 | 184 | $form->add('template', null, [ |
@@ -38,7 +38,7 @@ |
||
38 | 38 | ->add('name') |
39 | 39 | ->add('rel', ChoiceType::class, ['choices' => ['media', 'image', 'slideshow', 'video']]) |
40 | 40 | ->add('parent', EntityType::class, ['class' => 'Victoire\Bundle\MediaBundle\Entity\Folder', 'required' => false, |
41 | - 'query_builder' => function (\Doctrine\ORM\EntityRepository $er) use ($folder, $type) { |
|
41 | + 'query_builder' => function(\Doctrine\ORM\EntityRepository $er) use ($folder, $type) { |
|
42 | 42 | $qb = $er->createQueryBuilder('folder'); |
43 | 43 | |
44 | 44 | if ($folder != null && $folder->getId() != null) { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | |
58 | 58 | $ids = [$tree->getViewId()]; |
59 | 59 | |
60 | - $getChildrenIds = function (ViewReference $tree) use (&$getChildrenIds, $ids) { |
|
60 | + $getChildrenIds = function(ViewReference $tree) use (&$getChildrenIds, $ids) { |
|
61 | 61 | foreach ($tree->getChildren() as $child) { |
62 | 62 | $ids[] = $child->getViewId(); |
63 | 63 | $ids = array_merge($ids, $getChildrenIds($child)); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | 'options' => [ |
43 | 43 | 'choices' => $this->availableLocales, |
44 | 44 | 'choices_as_values' => true, |
45 | - 'choice_label' => function ($value) { |
|
45 | + 'choice_label' => function($value) { |
|
46 | 46 | return $value; |
47 | 47 | }, |
48 | 48 | ], |
@@ -59,7 +59,7 @@ |
||
59 | 59 | 'options' => [ |
60 | 60 | 'choices' => $this->getDomainName(), |
61 | 61 | 'choices_as_values' => true, |
62 | - 'choice_label' => function ($value) { |
|
62 | + 'choice_label' => function($value) { |
|
63 | 63 | return $value; |
64 | 64 | }, |
65 | 65 | ], |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | $builder->addEventListener( |
26 | 26 | FormEvents::PRE_SET_DATA, |
27 | - function (FormEvent $event) use ($options) { |
|
27 | + function(FormEvent $event) use ($options) { |
|
28 | 28 | //we get the raw data for the widget form |
29 | 29 | $name = $event->getData()->getName(); |
30 | 30 | $formParams = $options['dataSources']->getDataSource($name)->{$options['dataSources']->getDataSourceParameters($name)['method'].'FormParams'}(); |
@@ -118,7 +118,7 @@ |
||
118 | 118 | ->getQuery() |
119 | 119 | ->getResult(); |
120 | 120 | $templates = []; |
121 | - $recursiveGetTemplates = function ($template) use (&$recursiveGetTemplates, &$templates) { |
|
121 | + $recursiveGetTemplates = function($template) use (&$recursiveGetTemplates, &$templates) { |
|
122 | 122 | array_push($templates, $template); |
123 | 123 | foreach ($template->getInheritors() as $_template) { |
124 | 124 | if ($_template instanceof Template) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'attr' => [ |
74 | 74 | 'class' => 'add_'.$options['business_entity_id'].'_link picker_entity_select', |
75 | 75 | ], |
76 | - 'query_builder' => function (EntityRepository $er) use ($businessEntity, $locale) { |
|
76 | + 'query_builder' => function(EntityRepository $er) use ($businessEntity, $locale) { |
|
77 | 77 | // Don't display entities that don't have translations in the current locale. |
78 | 78 | if (in_array(Translatable::class, class_uses($businessEntity->getClass()))) { |
79 | 79 | return $er->createQueryBuilder('entity') |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | |
90 | 90 | $builder->get('ressourceId')->addModelTransformer( |
91 | 91 | new CallbackTransformer( |
92 | - function ($idToEntity) use ($entityManager, $businessEntity) { |
|
92 | + function($idToEntity) use ($entityManager, $businessEntity) { |
|
93 | 93 | // transform the array to a string |
94 | 94 | return $entityManager->getRepository($businessEntity->getClass())->findOneById($idToEntity); |
95 | 95 | }, |
96 | - function ($entityToId) { |
|
96 | + function($entityToId) { |
|
97 | 97 | // transform the string back to an array |
98 | 98 | return $entityToId->getId(); |
99 | 99 | } |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | |
150 | 150 | $builder->get('businessEntity')->addModelTransformer( |
151 | 151 | new CallbackTransformer( |
152 | - function ($businessEntity) { |
|
152 | + function($businessEntity) { |
|
153 | 153 | return $businessEntity; |
154 | 154 | }, |
155 | - function ($nameToBusinessEntity) use ($entityManager) { |
|
155 | + function($nameToBusinessEntity) use ($entityManager) { |
|
156 | 156 | return $entityManager->getRepository( |
157 | 157 | 'VictoireBusinessEntityBundle:BusinessEntity' |
158 | 158 | )->findOneByName( |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $businessEntity = $options['businessEntity']; |
28 | 28 | $getMethod = $businessEntity->getGetMethod(); |
29 | 29 | preg_match_all('/{{([a-zA-Z]+)}}/', $getMethod, $matches); |
30 | - $identifiers = array_map(function ($property) { |
|
30 | + $identifiers = array_map(function($property) { |
|
31 | 31 | return $property->getName(); |
32 | 32 | }, |
33 | 33 | $businessEntity->getBusinessIdentifiers()->toArray() |