@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $widget = $widgetMap->getWidget(); |
| 44 | 44 | $widget->setWidgetMap($widgetMap); |
| 45 | 45 | $widgetMap->setWidget(null); |
| 46 | - if ($key % 100 == 0) { |
|
| 46 | + if ($key%100 == 0) { |
|
| 47 | 47 | $entityManager->flush(); |
| 48 | 48 | } |
| 49 | 49 | $progress->advance(); |
@@ -264,7 +264,7 @@ |
||
| 264 | 264 | |
| 265 | 265 | private function formatAttributes($attributes) |
| 266 | 266 | { |
| 267 | - array_walk($attributes, function (&$item, $key) { |
|
| 267 | + array_walk($attributes, function(&$item, $key) { |
|
| 268 | 268 | if (is_array($item)) { |
| 269 | 269 | $item = implode($item, ' '); |
| 270 | 270 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | 'options' => [ |
| 51 | 51 | 'choices' => $this->getAllAvailableRoles($this->roleHierarchy), |
| 52 | 52 | 'choices_as_values' => true, |
| 53 | - 'choice_label' => function ($value) { |
|
| 53 | + 'choice_label' => function($value) { |
|
| 54 | 54 | return $value; |
| 55 | 55 | }, |
| 56 | 56 | ], |
@@ -443,7 +443,7 @@ |
||
| 443 | 443 | */ |
| 444 | 444 | private function getPageRoles(View $view) |
| 445 | 445 | { |
| 446 | - $insertAncestorRole = function (View $view = null) use (&$insertAncestorRole) { |
|
| 446 | + $insertAncestorRole = function(View $view = null) use (&$insertAncestorRole) { |
|
| 447 | 447 | if ($view === null) { |
| 448 | 448 | return; |
| 449 | 449 | } |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | * @param bool $autoload |
| 103 | 103 | * @return array |
| 104 | 104 | */ |
| 105 | - $class_uses_deep = function ($class, $autoload = true) { |
|
| 105 | + $class_uses_deep = function($class, $autoload = true) { |
|
| 106 | 106 | $traits = []; |
| 107 | 107 | do { |
| 108 | 108 | $traits = array_merge(class_uses($class, $autoload), $traits); |
@@ -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 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | 'attr' => [ |
| 52 | 52 | 'class' => 'add_'.$options['business_entity_id'].'_link picker_entity_select', |
| 53 | 53 | ], |
| 54 | - 'query_builder' => function (EntityRepository $er) use ($options, $locale) { |
|
| 54 | + 'query_builder' => function(EntityRepository $er) use ($options, $locale) { |
|
| 55 | 55 | // Don't display entities that don't have translations in the current locale. |
| 56 | 56 | if (in_array(Translatable::class, class_uses($options['namespace']))) { |
| 57 | 57 | return $er->createQueryBuilder('entity') |
@@ -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) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | 'choices' => $options['linkTypeChoices'], |
| 65 | 65 | 'choices_as_values' => true, |
| 66 | 66 | ]) |
| 67 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($builder, $options) { |
|
| 67 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($builder, $options) { |
|
| 68 | 68 | /** @var Link $data */ |
| 69 | 69 | $data = $event->getData(); |
| 70 | 70 | $form = $event->getForm(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | }); |
| 75 | 75 | |
| 76 | 76 | $builder |
| 77 | - ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($builder, $options) { |
|
| 77 | + ->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($builder, $options) { |
|
| 78 | 78 | $form = $event->getForm(); |
| 79 | 79 | $data = $event->getData(); |
| 80 | 80 | $locale = isset($data['locale']) ? $data['locale'] : null; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | 'label' => 'form.link_type.target.modalLayouts.label', |
| 213 | 213 | 'required' => true, |
| 214 | 214 | 'choices' => $this->modalLayouts, |
| 215 | - 'choice_label' => function ($value, $key, $index) { |
|
| 215 | + 'choice_label' => function($value, $key, $index) { |
|
| 216 | 216 | return 'form.link_type.target.modalLayouts.choices.'.$value; |
| 217 | 217 | }, |
| 218 | 218 | 'choices_as_values' => true, |