@@ -57,7 +57,7 @@ |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * @param [] $tree |
|
60 | + * @param WebViewInterface[] $tree |
|
61 | 61 | */ |
62 | 62 | public function buildViewReferenceRecursively($tree, EntityManager $entityManager, $isRoot = true) |
63 | 63 | { |
@@ -140,7 +140,7 @@ |
||
140 | 140 | * Create a $slot array that'll contain, for each slot, a widgetmap id as key and a widgetmap as value |
141 | 141 | * Do not keeps widgetMaps that are overwrited. |
142 | 142 | * |
143 | - * @param $widgetMaps |
|
143 | + * @param WidgetMap[] $widgetMaps |
|
144 | 144 | * |
145 | 145 | * @return array |
146 | 146 | */ |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * |
31 | 31 | * @throws \Exception |
32 | 32 | * |
33 | - * @return bool |
|
33 | + * @return boolean|null |
|
34 | 34 | */ |
35 | 35 | protected function execute(InputInterface $input, OutputInterface $output) |
36 | 36 | { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * Inject Widgets in View's builtWidgetMap. |
73 | 73 | * |
74 | 74 | * @param View $view |
75 | - * @param $viewWidgets |
|
75 | + * @param Widget[] $viewWidgets |
|
76 | 76 | */ |
77 | 77 | private function injectWidgets(View $view, $viewWidgets) |
78 | 78 | { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @throws \Throwable |
184 | 184 | * @throws \TypeError |
185 | 185 | * |
186 | - * @return array |
|
186 | + * @return Widget[] |
|
187 | 187 | */ |
188 | 188 | private function setAssociatedEntities(array $repositories) |
189 | 189 | { |
@@ -193,7 +193,7 @@ |
||
193 | 193 | foreach ($findMethods as $findMethod => $associatedEntitiesToWarm) { |
194 | 194 | |
195 | 195 | //Extract ids to search |
196 | - $idsToSearch = array_map(function ($associatedEntityToWarm) { |
|
196 | + $idsToSearch = array_map(function($associatedEntityToWarm) { |
|
197 | 197 | return $associatedEntityToWarm->getEntityId(); |
198 | 198 | }, $associatedEntitiesToWarm); |
199 | 199 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @param Element $page |
71 | - * @param float|int $timeout |
|
71 | + * @param integer $timeout |
|
72 | 72 | */ |
73 | 73 | public function assertPageAddress($page, $timeout = 10000) |
74 | 74 | { |
@@ -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 | } |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function buildForm(FormBuilderInterface $builder, array $options) |
56 | 56 | { |
57 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
57 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
58 | 58 | $view = $event->getData(); |
59 | 59 | $form = $event->getForm(); |
60 | 60 | |
61 | 61 | $this->isNew = !$view || null === $view->getId(); |
62 | 62 | |
63 | 63 | if ($this->isNew) { |
64 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) { |
|
64 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) { |
|
65 | 65 | return $tr->getAll()->getInstance(); |
66 | 66 | }; |
67 | 67 | } else { |
68 | - $getAllTemplateWithoutMe = function (EntityRepository $tr) use ($view) { |
|
68 | + $getAllTemplateWithoutMe = function(EntityRepository $tr) use ($view) { |
|
69 | 69 | return $tr->getAll() |
70 | 70 | ->getInstance() |
71 | 71 | ->andWhere('template.id != :templateId') |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | //If view is an Article BEP, we do not allow to choose parent because it will be set automatically |
85 | 85 | if (!$view instanceof ArticleTemplate && ClassUtils::getClass($view) != 'Victoire\Bundle\TemplateBundle\Entity\Template') { |
86 | 86 | if (!$view || null === $view->getId()) { |
87 | - $getAllPageWithoutMe = function (EntityRepository $repo) { |
|
87 | + $getAllPageWithoutMe = function(EntityRepository $repo) { |
|
88 | 88 | return $repo->getAll()->getInstance(); |
89 | 89 | }; |
90 | 90 | } else { |
91 | - $getAllPageWithoutMe = function (EntityRepository $repo) use ($view) { |
|
91 | + $getAllPageWithoutMe = function(EntityRepository $repo) use ($view) { |
|
92 | 92 | return $repo->getAll() |
93 | 93 | ->getInstance() |
94 | 94 | ->andWhere('view.id != :pageId') |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | //we use the PRE_SUBMIT event to set the mode option |
76 | 76 | $builder->addEventListener( |
77 | 77 | FormEvents::PRE_SUBMIT, |
78 | - function (FormEvent $event) use ($options) { |
|
78 | + function(FormEvent $event) use ($options) { |
|
79 | 79 | //we get the raw data for the widget form |
80 | 80 | $rawData = $event->getData(); |
81 | 81 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | ]); |
119 | 119 | $builder->addEventListener( |
120 | 120 | FormEvents::PRE_SET_DATA, |
121 | - function (FormEvent $event) use ($options) { |
|
121 | + function(FormEvent $event) use ($options) { |
|
122 | 122 | $dataSources = $options['dataSources']->getDataSources(); |
123 | 123 | $widget = $event->getData(); |
124 | 124 | foreach ($dataSources as $alias => $dataSource) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ); |
133 | 133 | $builder->addEventListener( |
134 | 134 | FormEvents::POST_SUBMIT, |
135 | - function (FormEvent $event) use ($options) { |
|
135 | + function(FormEvent $event) use ($options) { |
|
136 | 136 | $widget = $event->getData(); |
137 | 137 | /** @var Criteria $criteria */ |
138 | 138 | foreach ($widget->getCriterias() as $criteria) { |
@@ -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') |