@@ -117,7 +117,7 @@ |
||
| 117 | 117 | private function generateHash(Widget $widget) |
| 118 | 118 | { |
| 119 | 119 | $roleHash = ''; |
| 120 | - array_map(function ($role) use (&$roleHash) { |
|
| 120 | + array_map(function($role) use (&$roleHash) { |
|
| 121 | 121 | $roleHash .= $this->authorizationChecker->isGranted($role) ? $role : ''; |
| 122 | 122 | }, ['ROLE_VICTOIRE_DEVELOPER', 'ROLE_VICTOIRE', 'ROLE_VICTOIRE_BLOG', 'ROLE_VICTOIRE_LEFTNAVBAR', 'ROLE_VICTOIRE_BET', 'ROLE_VICTOIRE_PAGE_DEBUG', 'ROLE_VICTOIRE_STYLE']); |
| 123 | 123 | |
@@ -473,7 +473,7 @@ |
||
| 473 | 473 | */ |
| 474 | 474 | public function hasCriteriaNamed($criteriaAlias) |
| 475 | 475 | { |
| 476 | - return $this->criterias->exists(function ($key, Criteria $element) use ($criteriaAlias) { |
|
| 476 | + return $this->criterias->exists(function($key, Criteria $element) use ($criteriaAlias) { |
|
| 477 | 477 | return $criteriaAlias === $element->getName(); |
| 478 | 478 | }); |
| 479 | 479 | } |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | |
| 110 | 110 | findIds($category, $categoryIds); |
| 111 | 111 | |
| 112 | - $articles = $articles->filter(function ($article) use ($categoryIds) { |
|
| 112 | + $articles = $articles->filter(function($article) use ($categoryIds) { |
|
| 113 | 113 | /* @var Article $article */ |
| 114 | 114 | return $article->getCategory() && in_array($article->getCategory()->getId(), $categoryIds, true); |
| 115 | 115 | }); |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | public function getPublishedArticles() |
| 76 | 76 | { |
| 77 | - return $this->articles->filter(function (Article $article) { |
|
| 77 | + return $this->articles->filter(function(Article $article) { |
|
| 78 | 78 | return $article->getStatus() === PageStatus::PUBLISHED |
| 79 | 79 | && $article->getPublishedAt() <= new \DateTime(); |
| 80 | 80 | }); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | $builder->addEventListener( |
| 50 | 50 | FormEvents::PRE_SET_DATA, |
| 51 | - function (FormEvent $event) { |
|
| 51 | + function(FormEvent $event) { |
|
| 52 | 52 | $entity = $event->getData(); |
| 53 | 53 | |
| 54 | 54 | if ($entity !== null) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | $builder->addEventListener( |
| 71 | 71 | FormEvents::PRE_SUBMIT, |
| 72 | - function (FormEvent $event) { |
|
| 72 | + function(FormEvent $event) { |
|
| 73 | 73 | $rawData = $event->getData(); |
| 74 | 74 | if (isset($rawData['children'])) { |
| 75 | 75 | $addChildren = true; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ->add('author', null, [ |
| 59 | 59 | 'label' => 'form.article.type.author.label', |
| 60 | 60 | 'required' => true, |
| 61 | - 'query_builder' => function (EntityRepository $er) { |
|
| 61 | + 'query_builder' => function(EntityRepository $er) { |
|
| 62 | 62 | return $er->createQueryBuilder('user') |
| 63 | 63 | ->where('user.roles LIKE :roles') |
| 64 | 64 | ->setParameter('roles', '%ROLE_VICTOIRE%'); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | ]) |
| 67 | 67 | ->remove('visibleOnFront'); |
| 68 | 68 | |
| 69 | - $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 69 | + $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 70 | 70 | $data = $event->getData(); |
| 71 | 71 | $parent = $event->getForm()->getParent(); |
| 72 | 72 | $this->manageCategories($data, $parent); |
@@ -74,19 +74,19 @@ discard block |
||
| 74 | 74 | $this->manageLocales($data, $parent); |
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | - $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 77 | + $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 78 | 78 | $data = $event->getData(); |
| 79 | 79 | $parent = $event->getForm()->getParent(); |
| 80 | 80 | $this->manageCategories($data, $parent); |
| 81 | 81 | $this->manageLocales($data, $parent); |
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 84 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 85 | 85 | $data = $event->getData(); |
| 86 | 86 | $form = $event->getForm(); |
| 87 | 87 | $this->manageTags($data, $form); |
| 88 | 88 | }); |
| 89 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 89 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 90 | 90 | $form = $event->getForm(); |
| 91 | 91 | $data = $form->getData(); |
| 92 | 92 | $this->manageTags($data, $form); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $form->add('tags', TagsType::class, [ |
| 102 | 102 | 'required' => false, |
| 103 | 103 | 'multiple' => true, |
| 104 | - 'query_builder' => function (TagRepository $er) use ($data) { |
|
| 104 | + 'query_builder' => function(TagRepository $er) use ($data) { |
|
| 105 | 105 | $qb = $er->filterByBlog($data->getBlog())->getInstance(); |
| 106 | 106 | $er->clearInstance(); |
| 107 | 107 | |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | if (!$form->getData()->getTemplate()) { |
| 182 | 182 | if ($articleTemplateRepo->filterByBlog($blog_id)->getCount('parent')->run('getSingleScalarResult') > 1) { |
| 183 | - $articleTemplates = function (ArticleTemplateRepository $repo) use ($blog_id) { |
|
| 183 | + $articleTemplates = function(ArticleTemplateRepository $repo) use ($blog_id) { |
|
| 184 | 184 | return $repo->filterByBlog($blog_id)->getInstance(); |
| 185 | 185 | }; |
| 186 | 186 | $form->add('template', null, [ |
| 187 | 187 | 'label' => 'form.article.type.template.label', |
| 188 | - 'choice_label' => function (ArticleTemplate $template) { |
|
| 188 | + 'choice_label' => function(ArticleTemplate $template) { |
|
| 189 | 189 | return $template->getBackendName(); |
| 190 | 190 | }, |
| 191 | 191 | 'required' => true, |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $builder->addEventListener( |
| 56 | 56 | FormEvents::PRE_SET_DATA, |
| 57 | - function (FormEvent $event) use ($currentLocale, $currentBlog, $localesNb, $blogsNb) { |
|
| 57 | + function(FormEvent $event) use ($currentLocale, $currentBlog, $localesNb, $blogsNb) { |
|
| 58 | 58 | $data = $event->getData(); |
| 59 | 59 | $event->setData([ |
| 60 | 60 | 'locale' => $data['locale'] !== null ? $data['locale'] : $currentLocale, |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | if ($localesNb > 1 && $blogsNb > 1) { |
| 68 | 68 | $builder->addEventListener( |
| 69 | 69 | FormEvents::PRE_SUBMIT, |
| 70 | - function (FormEvent $event) use ($currentLocale, $currentBlog, $blogsNb, $localesNb) { |
|
| 70 | + function(FormEvent $event) use ($currentLocale, $currentBlog, $blogsNb, $localesNb) { |
|
| 71 | 71 | $data = $event->getData(); |
| 72 | 72 | $currentLocale = $data['locale'] !== null ? $data['locale'] : $currentLocale; |
| 73 | 73 | $availableBlogs = $localesNb > 1 ? $this->blogRepository->getBlogsForLocale($currentLocale) : $this->blogRepository->findAll(); |
@@ -124,10 +124,10 @@ discard block |
||
| 124 | 124 | $additionalParameters = [ |
| 125 | 125 | 'choices' => $availableBlogs, |
| 126 | 126 | 'choices_as_values' => true, |
| 127 | - 'choice_value' => function (Blog $currentBlog) { |
|
| 127 | + 'choice_value' => function(Blog $currentBlog) { |
|
| 128 | 128 | return $currentBlog->getId(); |
| 129 | 129 | }, |
| 130 | - 'choice_label' => function (Blog $currentBlog) use ($currentLocale) { |
|
| 130 | + 'choice_label' => function(Blog $currentBlog) use ($currentLocale) { |
|
| 131 | 131 | $currentBlog->setCurrentLocale($currentLocale); |
| 132 | 132 | |
| 133 | 133 | return $currentBlog->getName(); |