@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | ]); |
239 | 239 | |
240 | 240 | $question = new Question($questionHelper->getQuestion('Widget name', $input->getOption('bundle-name'))); |
241 | - $question->setValidator(function ($answer) { |
|
241 | + $question->setValidator(function($answer) { |
|
242 | 242 | return self::validateWidgetName($answer, false); |
243 | 243 | }); |
244 | 244 | |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | ]); |
286 | 286 | |
287 | 287 | $question = new Question($questionHelper->getQuestion('Parent widget name', false)); |
288 | - $question->setValidator(function ($answer) { |
|
288 | + $question->setValidator(function($answer) { |
|
289 | 289 | return self::validateWidgetName($answer, false); |
290 | 290 | }); |
291 | 291 | $parent = $questionHelper->ask($input, $output, $question); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | ]); |
311 | 311 | |
312 | 312 | $question = new Question($questionHelper->getQuestion('Target directory', $dir), $dir); |
313 | - $question->setValidator(function ($dir) use ($bundle, $namespace) { |
|
313 | + $question->setValidator(function($dir) use ($bundle, $namespace) { |
|
314 | 314 | return Validators::validateTargetDir($dir, $bundle, $namespace); |
315 | 315 | }); |
316 | 316 | $dir = $questionHelper->ask($input, $output, $question); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | } |
487 | 487 | $output->writeln(''); |
488 | 488 | |
489 | - $fieldValidator = function ($type) use ($types) { |
|
489 | + $fieldValidator = function($type) use ($types) { |
|
490 | 490 | if (!in_array($type, $types)) { |
491 | 491 | throw new \InvalidArgumentException(sprintf('Invalid type "%s".', $type)); |
492 | 492 | } |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | return $type; |
495 | 495 | }; |
496 | 496 | |
497 | - $lengthValidator = function ($length) { |
|
497 | + $lengthValidator = function($length) { |
|
498 | 498 | if (!$length) { |
499 | 499 | return $length; |
500 | 500 | } |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | |
517 | 517 | $question = new Question($questionHelper->getQuestion('New field name (press <return> to stop adding fields)', null)); |
518 | 518 | $question->setValidator( |
519 | - function ($name) use ($fields, $generator) { |
|
519 | + function($name) use ($fields, $generator) { |
|
520 | 520 | if (isset($fields[$name]) || 'id' == $name) { |
521 | 521 | throw new \InvalidArgumentException(sprintf('Field "%s" is already defined.', $name)); |
522 | 522 | } |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function buildForm(FormBuilderInterface $builder, array $options) |
56 | 56 | { |
57 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
57 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
58 | 58 | $view = $event->getData(); |
59 | 59 | $form = $event->getForm(); |
60 | 60 | |
61 | 61 | $this->isNew = !$view || null === $view->getId(); |
62 | 62 | |
63 | 63 | if ($this->isNew) { |
64 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) { |
|
64 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) { |
|
65 | 65 | return $tr->getAll()->getInstance(); |
66 | 66 | }; |
67 | 67 | } else { |
68 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) use ($view) { |
|
68 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) use ($view) { |
|
69 | 69 | return $tr->getAll() |
70 | 70 | ->getInstance() |
71 | 71 | ->andWhere('template.id != :templateId') |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | //If view is an Article BEP, we do not allow to choose parent because it will be set automatically |
85 | 85 | if (!$view instanceof ArticleTemplate && ClassUtils::getClass($view) != 'Victoire\Bundle\TemplateBundle\Entity\Template') { |
86 | 86 | if (!$view || null === $view->getId()) { |
87 | - $getAllPageWithoutMe = function (EntityRepository $repo) { |
|
87 | + $getAllPageWithoutMe = function(EntityRepository $repo) { |
|
88 | 88 | return $repo->getAll()->getInstance(); |
89 | 89 | }; |
90 | 90 | } else { |
91 | - $getAllPageWithoutMe = function (EntityRepository $repo) use ($view) { |
|
91 | + $getAllPageWithoutMe = function(EntityRepository $repo) use ($view) { |
|
92 | 92 | return $repo->getAll() |
93 | 93 | ->getInstance() |
94 | 94 | ->andWhere('view.id != :pageId') |
@@ -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) { |
@@ -62,7 +62,7 @@ |
||
62 | 62 | ]; |
63 | 63 | |
64 | 64 | for ($i = 1; $i <= 1000; $i++) { |
65 | - $buildSortedWidget = function ($builtWidgetMap) use (&$order, &$buildSortedWidget, $view) { |
|
65 | + $buildSortedWidget = function($builtWidgetMap) use (&$order, &$buildSortedWidget, $view) { |
|
66 | 66 | $sortedWidget['widgetMap'] = $builtWidgetMap['content'][array_rand($builtWidgetMap['content'])]; |
67 | 67 | $availablePositions = []; |
68 | 68 | $positions = [WidgetMap::POSITION_AFTER, WidgetMap::POSITION_BEFORE]; |
@@ -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'}(); |