@@ -73,7 +73,7 @@ |
||
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) { |
|
76 | + function(FormEvent $event) { |
|
77 | 77 | $options = $this->options; |
78 | 78 | |
79 | 79 | //we get the raw data for the widget form |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | // if the xml contains only one reference, it'll be flatten so it will miss one deep level, so we re-create it |
67 | 67 | if (count($cachedArray['viewReference']) === 1) { |
68 | - $cachedArray = array_map(function ($el) { |
|
68 | + $cachedArray = array_map(function($el) { |
|
69 | 69 | return [$el]; |
70 | 70 | }, $cachedArray); |
71 | 71 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | foreach ($viewsReferences as $key => $viewReference) { |
95 | 95 | // If viewReference is a persisted page, we want to clean virtual BEPs |
96 | 96 | if (!empty($viewReference['viewNamespace']) && $viewReference['viewNamespace'] == 'Victoire\Bundle\BusinessPageBundle\Entity\BusinessPage') { |
97 | - $viewsReferences = array_filter($viewsReferences, function ($_viewReference) use ($viewReference) { |
|
97 | + $viewsReferences = array_filter($viewsReferences, function($_viewReference) use ($viewReference) { |
|
98 | 98 | |
99 | 99 | // If my current viewReference already exists as a virtualBusinessPage, I remove it from viewReferences |
100 | 100 | $shouldRemove = !($_viewReference['viewNamespace'] == 'Victoire\Bundle\BusinessPageBundle\Entity\VirtualBusinessPage' |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $builder |
38 | 38 | ->add('name'); |
39 | 39 | |
40 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
40 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
41 | 41 | $view = $event->getData(); |
42 | 42 | $form = $event->getForm(); |
43 | 43 |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | return $this->children; |
297 | 297 | } |
298 | 298 | |
299 | - return $this->children->filter(function (Folder $entry) { |
|
299 | + return $this->children->filter(function(Folder $entry) { |
|
300 | 300 | if ($entry->isDeleted()) { |
301 | 301 | return false; |
302 | 302 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | return $this->media; |
365 | 365 | } |
366 | 366 | |
367 | - return $this->media->filter(function (Media $entry) { |
|
367 | + return $this->media->filter(function(Media $entry) { |
|
368 | 368 | if ($entry->isDeleted()) { |
369 | 369 | return false; |
370 | 370 | } |
@@ -153,11 +153,11 @@ |
||
153 | 153 | if ($size < 1024) { |
154 | 154 | return $size.'b'; |
155 | 155 | } else { |
156 | - $help = $size / 1024; |
|
156 | + $help = $size/1024; |
|
157 | 157 | if ($help < 1024) { |
158 | 158 | return round($help, 1).'kb'; |
159 | 159 | } else { |
160 | - return round(($help / 1024), 1).'mb'; |
|
160 | + return round(($help/1024), 1).'mb'; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | 'choices' => ['media' => 'media', 'image' => 'image', 'slideshow' => 'slideshow', 'video' => 'video'], |
49 | 49 | ]) |
50 | 50 | ->add('parent', 'entity', ['class' => 'Victoire\Bundle\MediaBundle\Entity\Folder', 'required' => false, |
51 | - 'query_builder' => function (\Doctrine\ORM\EntityRepository $er) use ($folder, $type) { |
|
51 | + 'query_builder' => function(\Doctrine\ORM\EntityRepository $er) use ($folder, $type) { |
|
52 | 52 | $qb = $er->createQueryBuilder('folder'); |
53 | 53 | |
54 | 54 | if ($folder != null && $folder->getId() != null) { |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'indexes' => [ |
40 | 40 | 'pages' => [ |
41 | 41 | 'types' => [ |
42 | - 'Pages' => [ |
|
42 | + 'Pages' => [ |
|
43 | 43 | 'serializer' => [ |
44 | 44 | 'groups' => ['search'], |
45 | 45 | ], |
@@ -29,7 +29,7 @@ |
||
29 | 29 | if (!$page && $deepMode) { |
30 | 30 | // Check for a same family error |
31 | 31 | // for example, for a 404 code, if the 404 error page doesn't exist, we check for a 400 errorPage |
32 | - $page = $this->findOneByCode(floor($code / 100) * 100); |
|
32 | + $page = $this->findOneByCode(floor($code/100)*100); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return $page; |
@@ -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 | } |