@@ -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 | //we use the PRE_SUBMIT event to set the mode option |
| 74 | 74 | $builder->addEventListener( |
| 75 | 75 | FormEvents::PRE_SUBMIT, |
| 76 | - function (FormEvent $event) use ($options) { |
|
| 76 | + function(FormEvent $event) use ($options) { |
|
| 77 | 77 | //we get the raw data for the widget form |
| 78 | 78 | $rawData = $event->getData(); |
| 79 | 79 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ]); |
| 118 | 118 | $builder->addEventListener( |
| 119 | 119 | FormEvents::PRE_SET_DATA, |
| 120 | - function (FormEvent $event) use ($options) { |
|
| 120 | + function(FormEvent $event) use ($options) { |
|
| 121 | 121 | $dataSources = $options['dataSources']->getDataSources(); |
| 122 | 122 | $widget = $event->getData(); |
| 123 | 123 | foreach ($dataSources as $alias => $dataSource) { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ); |
| 132 | 132 | $builder->addEventListener( |
| 133 | 133 | FormEvents::POST_SUBMIT, |
| 134 | - function (FormEvent $event) { |
|
| 134 | + function(FormEvent $event) { |
|
| 135 | 135 | $widget = $event->getData(); |
| 136 | 136 | /** @var Criteria $criteria */ |
| 137 | 137 | foreach ($widget->getCriterias() as $criteria) { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | ob_start(); |
| 21 | 21 | $loader = $this; |
| 22 | - $includeWrapper = function () use ($file, $loader) { |
|
| 22 | + $includeWrapper = function() use ($file, $loader) { |
|
| 23 | 23 | return include $file; |
| 24 | 24 | }; |
| 25 | 25 | $data = $includeWrapper(); |
@@ -141,7 +141,7 @@ |
||
| 141 | 141 | while ($file = readdir($openFolder)) { |
| 142 | 142 | if ($file != '.' && $file != '..') { |
| 143 | 143 | // Remove file |
| 144 | - $recursiveDelete = function ($str) use (&$recursiveDelete) { |
|
| 144 | + $recursiveDelete = function($str) use (&$recursiveDelete) { |
|
| 145 | 145 | if (is_file($str)) { |
| 146 | 146 | return @unlink($str); |
| 147 | 147 | } elseif (is_dir($str)) { |
@@ -53,18 +53,18 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 55 | 55 | { |
| 56 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 56 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 57 | 57 | $view = $event->getData(); |
| 58 | 58 | $form = $event->getForm(); |
| 59 | 59 | |
| 60 | 60 | $this->isNew = !$view || null === $view->getId(); |
| 61 | 61 | |
| 62 | 62 | if ($this->isNew) { |
| 63 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) { |
|
| 63 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) { |
|
| 64 | 64 | return $tr->getAll()->getInstance(); |
| 65 | 65 | }; |
| 66 | 66 | } else { |
| 67 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) use ($view) { |
|
| 67 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) use ($view) { |
|
| 68 | 68 | return $tr->getAll() |
| 69 | 69 | ->getInstance() |
| 70 | 70 | ->andWhere('template.id != :templateId') |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | if (!$form->has('template')) { |
| 75 | 75 | $form->add('template', null, [ |
| 76 | 76 | 'label' => 'form.view.type.template.label', |
| 77 | - 'choice_label' => function ($view) { |
|
| 77 | + 'choice_label' => function($view) { |
|
| 78 | 78 | return $view->getName(); |
| 79 | 79 | }, |
| 80 | 80 | 'required' => !$view instanceof Template || $view instanceof BusinessTemplate, |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | //If view is an Article BEP, we do not allow to choose parent because it will be set automatically |
| 86 | 86 | if (!$view instanceof ArticleTemplate && ClassUtils::getClass($view) != 'Victoire\Bundle\TemplateBundle\Entity\Template') { |
| 87 | 87 | if (!$view || null === $view->getId()) { |
| 88 | - $getAllPageWithoutMe = function (EntityRepository $repo) { |
|
| 88 | + $getAllPageWithoutMe = function(EntityRepository $repo) { |
|
| 89 | 89 | return $repo->getAll()->getInstance(); |
| 90 | 90 | }; |
| 91 | 91 | } else { |
| 92 | - $getAllPageWithoutMe = function (EntityRepository $repo) use ($view) { |
|
| 92 | + $getAllPageWithoutMe = function(EntityRepository $repo) use ($view) { |
|
| 93 | 93 | return $repo->getAll() |
| 94 | 94 | ->getInstance() |
| 95 | 95 | ->andWhere('view.id != :pageId') |
@@ -207,7 +207,7 @@ |
||
| 207 | 207 | $associatedEntitiesToWarm = $groupedAssociatedEntitiesToWarm['entitiesToWarm']; |
| 208 | 208 | |
| 209 | 209 | //Extract ids to search |
| 210 | - $idsToSearch = array_map(function ($associatedEntityToWarm) { |
|
| 210 | + $idsToSearch = array_map(function($associatedEntityToWarm) { |
|
| 211 | 211 | return $associatedEntityToWarm->getEntityId(); |
| 212 | 212 | }, $associatedEntitiesToWarm); |
| 213 | 213 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $ids = [$tree->getViewId()]; |
| 69 | 69 | |
| 70 | - $getChildrenIds = function (ViewReference $tree) use (&$getChildrenIds, $ids) { |
|
| 70 | + $getChildrenIds = function(ViewReference $tree) use (&$getChildrenIds, $ids) { |
|
| 71 | 71 | foreach ($tree->getChildren() as $child) { |
| 72 | 72 | if (null !== $child->getViewId()) { |
| 73 | 73 | $ids[] = $child->getViewId(); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $items = array_merge($pages, $this->getBusinessPages($tree)); |
| 95 | 95 | usort( |
| 96 | 96 | $items, |
| 97 | - function ($a, $b) { |
|
| 97 | + function($a, $b) { |
|
| 98 | 98 | return strcmp($a->getUrl(), $b->getUrl()); |
| 99 | 99 | } |
| 100 | 100 | ); |