@@ -40,14 +40,14 @@ |
||
| 40 | 40 | ->add('image', 'media'); |
| 41 | 41 | |
| 42 | 42 | // manage conditional related status in preset data |
| 43 | - $builder->get('status')->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 43 | + $builder->get('status')->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 44 | 44 | $data = $event->getData(); |
| 45 | 45 | $form = $event->getForm(); |
| 46 | 46 | self::manageRelatedStatus($data, $form->getParent()); |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | 49 | // manage conditional related status in pre submit (ajax call to refresh view) |
| 50 | - $builder->get('status')->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 50 | + $builder->get('status')->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 51 | 51 | $form = $event->getForm(); |
| 52 | 52 | $data = $event->getData(); |
| 53 | 53 | self::manageRelatedStatus($data, $form->getParent()); |
@@ -59,25 +59,25 @@ discard block |
||
| 59 | 59 | ]) |
| 60 | 60 | ->remove('visibleOnFront'); |
| 61 | 61 | |
| 62 | - $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 62 | + $builder->get('blog')->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 63 | 63 | $data = $event->getData(); |
| 64 | 64 | $parent = $event->getForm()->getParent(); |
| 65 | 65 | $this->manageCategories($data, $parent); |
| 66 | 66 | $this->manageTemplate($data, $parent); |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | - $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 69 | + $builder->get('blog')->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 70 | 70 | $data = $event->getData(); |
| 71 | 71 | $parent = $event->getForm()->getParent(); |
| 72 | 72 | $this->manageCategories($data, $parent); |
| 73 | 73 | }); |
| 74 | 74 | |
| 75 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 75 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 76 | 76 | $data = $event->getData(); |
| 77 | 77 | $form = $event->getForm(); |
| 78 | 78 | $this->manageTags($data, $form); |
| 79 | 79 | }); |
| 80 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 80 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 81 | 81 | $form = $event->getForm(); |
| 82 | 82 | $data = $form->getData(); |
| 83 | 83 | $this->manageTags($data, $form); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $form->add('tags', 'tags', [ |
| 93 | 93 | 'required' => false, |
| 94 | 94 | 'multiple' => true, |
| 95 | - 'query_builder' => function (TagRepository $er) use ($data) { |
|
| 95 | + 'query_builder' => function(TagRepository $er) use ($data) { |
|
| 96 | 96 | $qb = $er->filterByBlog($data->getBlog())->getInstance(); |
| 97 | 97 | $er->clearInstance(); |
| 98 | 98 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if (!$form->getData()->getTemplate()) { |
| 137 | 137 | if ($articleTemplateRepo->filterByBlog($blog_id)->getCount('parent')->run('getSingleScalarResult') > 1) { |
| 138 | - $articleTemplates = function (ArticleTemplateRepository $repo) use ($blog_id) { |
|
| 138 | + $articleTemplates = function(ArticleTemplateRepository $repo) use ($blog_id) { |
|
| 139 | 139 | return $repo->filterByBlog($blog_id)->getInstance(); |
| 140 | 140 | }; |
| 141 | 141 | $form->add('template', null, [ |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | $builder->addEventListener( |
| 42 | 42 | FormEvents::PRE_SET_DATA, |
| 43 | - function ($event) { |
|
| 43 | + function($event) { |
|
| 44 | 44 | $entity = $event->getData(); |
| 45 | 45 | |
| 46 | 46 | if ($entity !== null) { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | $builder->addEventListener( |
| 64 | 64 | FormEvents::PRE_SUBMIT, |
| 65 | - function ($event) { |
|
| 65 | + function($event) { |
|
| 66 | 66 | $rawData = $event->getData(); |
| 67 | 67 | if (isset($rawData['children'])) { |
| 68 | 68 | $addChildren = true; |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | class VirtualToBusinessPageTransformer |
| 9 | 9 | { |
| 10 | - public function transform(VirtualBusinessPage &$sourceObject) |
|
| 10 | + public function transform(VirtualBusinessPage & $sourceObject) |
|
| 11 | 11 | { |
| 12 | 12 | $bp = new BusinessPage(); |
| 13 | 13 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function fetch($id) |
| 42 | 42 | { |
| 43 | - $id = $this->uniqId + '-' + $id; |
|
| 43 | + $id = $this->uniqId + '-' +$id; |
|
| 44 | 44 | if ($this->contains($id)) { |
| 45 | 45 | return $this->cache->fetch($id); |
| 46 | 46 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function save($id, $data) |
| 60 | 60 | { |
| 61 | - $id = $this->uniqId + '-' + $id; |
|
| 61 | + $id = $this->uniqId + '-' +$id; |
|
| 62 | 62 | if (!$this->apcIsEnabled()) { |
| 63 | 63 | return false; |
| 64 | 64 | } |
@@ -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 | } |
@@ -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 | } |