@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | ]); |
| 237 | 237 | |
| 238 | 238 | $question = new Question($questionHelper->getQuestion('Widget name', $input->getOption('bundle-name'))); |
| 239 | - $question->setValidator(function ($answer) { |
|
| 239 | + $question->setValidator(function($answer) { |
|
| 240 | 240 | return self::validateWidgetName($answer, false); |
| 241 | 241 | }); |
| 242 | 242 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | ]); |
| 284 | 284 | |
| 285 | 285 | $question = new Question($questionHelper->getQuestion('Parent widget name', false)); |
| 286 | - $question->setValidator(function ($answer) { |
|
| 286 | + $question->setValidator(function($answer) { |
|
| 287 | 287 | return self::validateWidgetName($answer, false); |
| 288 | 288 | }); |
| 289 | 289 | $parent = $questionHelper->ask($input, $output, $question); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | ]); |
| 309 | 309 | |
| 310 | 310 | $question = new Question($questionHelper->getQuestion('Target directory', $dir), $dir); |
| 311 | - $question->setValidator(function ($dir) use ($bundle, $namespace) { |
|
| 311 | + $question->setValidator(function($dir) use ($bundle, $namespace) { |
|
| 312 | 312 | return Validators::validateTargetDir($dir, $bundle, $namespace); |
| 313 | 313 | }); |
| 314 | 314 | $dir = $questionHelper->ask($input, $output, $question); |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | } |
| 478 | 478 | $output->writeln(''); |
| 479 | 479 | |
| 480 | - $fieldValidator = function ($type) use ($types) { |
|
| 480 | + $fieldValidator = function($type) use ($types) { |
|
| 481 | 481 | if (!in_array($type, $types)) { |
| 482 | 482 | throw new \InvalidArgumentException(sprintf('Invalid type "%s".', $type)); |
| 483 | 483 | } |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | return $type; |
| 486 | 486 | }; |
| 487 | 487 | |
| 488 | - $lengthValidator = function ($length) { |
|
| 488 | + $lengthValidator = function($length) { |
|
| 489 | 489 | if (!$length) { |
| 490 | 490 | return $length; |
| 491 | 491 | } |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | |
| 508 | 508 | $question = new Question($questionHelper->getQuestion('New field name (press <return> to stop adding fields)', null)); |
| 509 | 509 | $question->setValidator( |
| 510 | - function ($name) use ($fields, $generator) { |
|
| 510 | + function($name) use ($fields, $generator) { |
|
| 511 | 511 | if (isset($fields[$name]) || 'id' == $name) { |
| 512 | 512 | throw new \InvalidArgumentException(sprintf('Field "%s" is already defined.', $name)); |
| 513 | 513 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | 'required' => false, |
| 61 | 61 | 'mapped' => false, |
| 62 | 62 | ]) |
| 63 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 63 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 64 | 64 | /* |
| 65 | 65 | * Generate form fields for each part of form |
| 66 | 66 | * Example, generate Static content, XS and SM as color forms |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | 'data-refreshOnChange' => 'true', |
| 119 | 119 | ], |
| 120 | 120 | ]) |
| 121 | - ->get('containerBackgroundType'.$key)->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($key) { |
|
| 121 | + ->get('containerBackgroundType'.$key)->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($key) { |
|
| 122 | 122 | self::generateBackgroundFields($event->getForm()->getParent(), $key, $event->getData()); |
| 123 | 123 | }); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | // add theme field |
| 127 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 127 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 128 | 128 | $data = $event->getData(); |
| 129 | 129 | $form = $event->getForm(); |
| 130 | 130 | //guess the bundle name |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function iWaitSeconds($nbr) |
| 25 | 25 | { |
| 26 | - $this->getSession()->wait($nbr * 1000); |
|
| 26 | + $this->getSession()->wait($nbr*1000); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function getSymfonyProfile() |
@@ -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(); |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | while ($file = readdir($openFolder)) { |
| 152 | 152 | if ($file != '.' && $file != '..') { |
| 153 | 153 | // Remove file |
| 154 | - $recursiveDelete = function ($str) use (&$recursiveDelete) { |
|
| 154 | + $recursiveDelete = function($str) use (&$recursiveDelete) { |
|
| 155 | 155 | if (is_file($str)) { |
| 156 | 156 | return @unlink($str); |
| 157 | 157 | } elseif (is_dir($str)) { |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | $businessPageReference->setTemplateId($businessPage->getTemplate()->getId()); |
| 33 | 33 | $businessPageReference->setSlug( |
| 34 | 34 | $businessPage->getStaticUrl() != '' ? |
| 35 | - $businessPage->getStaticUrl() : |
|
| 36 | - $businessPage->getSlug() |
|
| 35 | + $businessPage->getStaticUrl() : $businessPage->getSlug() |
|
| 37 | 36 | ); |
| 38 | 37 | $businessPageReference->setEntityId($businessPage->getBusinessEntity()->getId()); |
| 39 | 38 | $businessPageReference->setEntityNamespace($em->getClassMetadata(get_class($businessPage->getBusinessEntity()))->name); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 41 | 41 | { |
| 42 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 42 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 43 | 43 | $view = $event->getData(); |
| 44 | 44 | $form = $event->getForm(); |
| 45 | 45 | |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | // Si aucune donnée n'est passée au formulaire, la donnée est "null". |
| 50 | 50 | // Ce doit être considéré comme une nouvelle "View" |
| 51 | 51 | if ($this->isNew) { |
| 52 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) { |
|
| 52 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) { |
|
| 53 | 53 | return $tr->getAll()->getInstance(); |
| 54 | 54 | }; |
| 55 | 55 | } else { |
| 56 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) use ($view) { |
|
| 56 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) use ($view) { |
|
| 57 | 57 | return $tr->getAll() |
| 58 | 58 | ->getInstance() |
| 59 | 59 | ->andWhere('template.id != :templateId') |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | // Si aucune donnée n'est passée au formulaire, la donnée est "null". |
| 86 | 86 | // Ce doit être considéré comme une nouvelle "View" |
| 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('page.id != :pageId') |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | return $collection; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - protected function addVictoireRouting(RouteCollection &$collection) |
|
| 32 | + protected function addVictoireRouting(RouteCollection & $collection) |
|
| 33 | 33 | { |
| 34 | 34 | $resources = [ |
| 35 | 35 | '@VictoireAnalyticsBundle/Controller/', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - protected function addWidgetsRouting(RouteCollection &$collection) |
|
| 52 | + protected function addWidgetsRouting(RouteCollection & $collection) |
|
| 53 | 53 | { |
| 54 | 54 | foreach ($this->widgets as $widgetParams) { |
| 55 | 55 | $controllerResource = '@VictoireWidget'.$widgetParams['name'].'Bundle/Controller/'; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - protected function addShowBusinessPageByIdAction(RouteCollection &$collection) |
|
| 63 | + protected function addShowBusinessPageByIdAction(RouteCollection & $collection) |
|
| 64 | 64 | { |
| 65 | 65 | $pattern = '/victoire-dcms-public/show-business-page-by-id/{entityId}/{type}'; |
| 66 | 66 | $defaults = [ |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $collection->add($routeName, $route); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - protected function addShowPageByIdRoute(RouteCollection &$collection) |
|
| 77 | + protected function addShowPageByIdRoute(RouteCollection & $collection) |
|
| 78 | 78 | { |
| 79 | 79 | $pattern = '/victoire-dcms-public/show-page-by-id/{viewId}/{entityId}'; |
| 80 | 80 | $defaults = [ |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $collection->add($routeName, $route); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - protected function addShowPageRoute(RouteCollection &$collection) |
|
| 95 | + protected function addShowPageRoute(RouteCollection & $collection) |
|
| 96 | 96 | { |
| 97 | 97 | // prepare a new route |
| 98 | 98 | $pattern = '/{url}'; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $collection->add('victoire_core_page_show', $route); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - protected function addShowHomePageRoute(RouteCollection &$collection) |
|
| 111 | + protected function addShowHomePageRoute(RouteCollection & $collection) |
|
| 112 | 112 | { |
| 113 | 113 | // prepare a new route |
| 114 | 114 | $pattern = '/'; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | foreach ($references as $reference) { |
| 170 | 170 | $reference = $this->tools->unredislizeArray($reference); |
| 171 | 171 | if ($transform === true) { |
| 172 | - $transformViewReferenceFn = function ($parentViewReference) use (&$transformViewReferenceFn, $keepChildren) { |
|
| 172 | + $transformViewReferenceFn = function($parentViewReference) use (&$transformViewReferenceFn, $keepChildren) { |
|
| 173 | 173 | $transformer = ViewReferenceRedisDriver::findTransformerFromElement($parentViewReference); |
| 174 | 174 | $reference = $transformer->transform($parentViewReference); |
| 175 | 175 | if ($keepChildren) { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | { |
| 233 | 233 | $viewsReferences = []; |
| 234 | 234 | |
| 235 | - $prefixFn = function ($depth, $char0 = '└', $char = '─') { |
|
| 235 | + $prefixFn = function($depth, $char0 = '└', $char = '─') { |
|
| 236 | 236 | $prefix = $char0; |
| 237 | 237 | for ($i = 0; $i <= $depth; $i++) { |
| 238 | 238 | $prefix .= $char; |