@@ -21,8 +21,8 @@ |
||
| 21 | 21 | { |
| 22 | 22 | $form = $this->initForm(); |
| 23 | 23 | |
| 24 | - $form->add('authorEmail', EmailType::class, ['constraints' => $this->getAuthorEmailConstraints()]); |
|
| 25 | - $form->add('authorName', null, ['constraints' => $this->getAuthorNameConstraints()]); |
|
| 24 | + $form->add('authorEmail', EmailType::class, [ 'constraints' => $this->getAuthorEmailConstraints() ]); |
|
| 25 | + $form->add('authorName', null, [ 'constraints' => $this->getAuthorNameConstraints() ]); |
|
| 26 | 26 | |
| 27 | 27 | return $form; |
| 28 | 28 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $form = $this->initForm(); |
| 24 | 24 | |
| 25 | - $form->add('authorName', null, ['constraints' => $this->getAuthorNameConstraints()]); |
|
| 25 | + $form->add('authorName', null, [ 'constraints' => $this->getAuthorNameConstraints() ]); |
|
| 26 | 26 | |
| 27 | 27 | return $form; |
| 28 | 28 | } |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | ->subject( |
| 81 | 81 | $this->translator->trans( |
| 82 | 82 | 'admin.conversation.notification.title.'.(count($messages) > 1 ? 'plural' : 'singular'), |
| 83 | - ['%appName%' => $this->appName] |
|
| 83 | + [ '%appName%' => $this->appName ] |
|
| 84 | 84 | ) |
| 85 | 85 | ) |
| 86 | 86 | ->from($this->emailFrom) |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | protected function configureFormFields(FormMapper $formMapper) |
| 23 | 23 | { |
| 24 | - $formMapper->with('admin.conversation.label.conversation', ['class' => 'col-md-8']) |
|
| 24 | + $formMapper->with('admin.conversation.label.conversation', [ 'class' => 'col-md-8' ]) |
|
| 25 | 25 | ->add('content', TextareaType::class, [ |
| 26 | - 'attr' => ['rows' => 6], |
|
| 26 | + 'attr' => [ 'rows' => 6 ], |
|
| 27 | 27 | 'label' => 'admin.conversation.content.label', |
| 28 | 28 | ]) |
| 29 | 29 | ->add('referring', TextType::class, [ |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ]) |
| 35 | 35 | ->end(); |
| 36 | 36 | |
| 37 | - $formMapper->with('admin.conversation.label.author', ['class' => 'col-md-4']) |
|
| 37 | + $formMapper->with('admin.conversation.label.author', [ 'class' => 'col-md-4' ]) |
|
| 38 | 38 | ->add('authorEmail', null, [ |
| 39 | 39 | 'label' => 'admin.conversation.authorEmail.label', |
| 40 | 40 | ]) |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ]) |
| 52 | 52 | ->end(); |
| 53 | 53 | |
| 54 | - $formMapper->with('admin.conversation.label.publishedAt', ['class' => 'col-md-4']) |
|
| 54 | + $formMapper->with('admin.conversation.label.publishedAt', [ 'class' => 'col-md-4' ]) |
|
| 55 | 55 | ->add('publishedAt', DateTimePickerType::class, [ |
| 56 | 56 | 'required' => false, |
| 57 | 57 | 'label' => '', |
@@ -22,8 +22,8 @@ |
||
| 22 | 22 | $form = $this->initForm(); |
| 23 | 23 | |
| 24 | 24 | if (!isset($user) || !$this->getUser()) { |
| 25 | - $form->add('authorEmail', EmailType::class, ['constraints' => $this->getAuthorEmailConstraints()]); |
|
| 26 | - $form->add('authorName', null, ['constraints' => $this->getAuthorNameConstraints()]); |
|
| 25 | + $form->add('authorEmail', EmailType::class, [ 'constraints' => $this->getAuthorEmailConstraints() ]); |
|
| 26 | + $form->add('authorName', null, [ 'constraints' => $this->getAuthorNameConstraints() ]); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $form->add('content', TextareaType::class); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | // sinon, passer l'id dans la session plutôt que dans la requête |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $form = $this->formFactory->createBuilder(FormType::class, $this->message, ['csrf_protection' => false]); |
|
| 113 | + $form = $this->formFactory->createBuilder(FormType::class, $this->message, [ 'csrf_protection' => false ]); |
|
| 114 | 114 | |
| 115 | 115 | $form->setAction($this->router->generate('piedweb_cms_conversation', [ |
| 116 | 116 | 'type' => $this->getType(), |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | public function getCurrentStep(): FormBuilderInterface |
| 126 | 126 | { |
| 127 | - $currentStepMethod = 'getStep'.self::$step[$this->getStep()]; |
|
| 127 | + $currentStepMethod = 'getStep'.self::$step[ $this->getStep() ]; |
|
| 128 | 128 | |
| 129 | 129 | return $this->$currentStepMethod(); |
| 130 | 130 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function validCurrentStep($form): string |
| 138 | 138 | { |
| 139 | - $currentStepMethod = 'valid'.self::$step[$this->getStep()]; |
|
| 139 | + $currentStepMethod = 'valid'.self::$step[ $this->getStep() ]; |
|
| 140 | 140 | if (method_exists($this, $currentStepMethod)) { |
| 141 | 141 | return $this->$currentStepMethod($form); |
| 142 | 142 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | protected function getNextStepFunctionName() |
| 212 | 212 | { |
| 213 | - $getFormMethod = 'getStep'.self::$step[$this->getNextStep()]; |
|
| 213 | + $getFormMethod = 'getStep'.self::$step[ $this->getNextStep() ]; |
|
| 214 | 214 | if (!method_exists($this, $getFormMethod)) { |
| 215 | 215 | return false; |
| 216 | 216 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | public function getFunctions() |
| 26 | 26 | { |
| 27 | 27 | return [ |
| 28 | - new TwigFunction('showConversation', [$this, 'showConversation'], [ |
|
| 29 | - 'is_safe' => ['html'], |
|
| 28 | + new TwigFunction('showConversation', [ $this, 'showConversation' ], [ |
|
| 29 | + 'is_safe' => [ 'html' ], |
|
| 30 | 30 | 'needs_environment' => true, |
| 31 | 31 | ]), |
| 32 | 32 | ]; |
@@ -42,6 +42,6 @@ discard block |
||
| 42 | 42 | $messages = $this->em->getRepository($this->messageEntity) |
| 43 | 43 | ->getMessagesPublishedByReferring($referring, $orderBy, $limit); |
| 44 | 44 | |
| 45 | - return $env->render($template, ['messages' => $messages]); |
|
| 45 | + return $env->render($template, [ 'messages' => $messages ]); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | ->andWhere('m.publishedAt is NOT NULL') |
| 22 | 22 | ->andWhere('m.referring = :referring') |
| 23 | 23 | ->setParameter('referring', $referring) |
| 24 | - ->orderBy('m.'.$orderBy[0], $orderBy[1]) |
|
| 24 | + ->orderBy('m.'.$orderBy[ 0 ], $orderBy[ 1 ]) |
|
| 25 | 25 | ->getQuery(); |
| 26 | 26 | |
| 27 | 27 | return $q->getResult(); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | protected $form; |
| 17 | 17 | |
| 18 | 18 | /** @var array */ |
| 19 | - protected $possibleOrigins = []; |
|
| 19 | + protected $possibleOrigins = [ ]; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * @var ParameterBagInterface |
@@ -80,17 +80,17 @@ discard block |
||
| 80 | 80 | $this->possibleOrigins = explode(' ', $this->params->get('pwc.conversation.possible_origins')); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - $this->possibleOrigins[] = 'https://'.$request->getHost(); |
|
| 84 | - $this->possibleOrigins[] = 'http://'.$request->getHost(); |
|
| 83 | + $this->possibleOrigins[ ] = 'https://'.$request->getHost(); |
|
| 84 | + $this->possibleOrigins[ ] = 'http://'.$request->getHost(); |
|
| 85 | 85 | // just for dev |
| 86 | - $this->possibleOrigins[] = 'http://'.$request->getHost().':8000'; |
|
| 87 | - $this->possibleOrigins[] = 'http://'.$request->getHost().':8001'; |
|
| 88 | - $this->possibleOrigins[] = 'http://'.$request->getHost().':8002'; |
|
| 86 | + $this->possibleOrigins[ ] = 'http://'.$request->getHost().':8000'; |
|
| 87 | + $this->possibleOrigins[ ] = 'http://'.$request->getHost().':8001'; |
|
| 88 | + $this->possibleOrigins[ ] = 'http://'.$request->getHost().':8002'; |
|
| 89 | 89 | |
| 90 | 90 | if ($this->params->has('pwc.apps')) { |
| 91 | 91 | foreach ($this->params->get('pwc.apps') as $app) { |
| 92 | - foreach ($app['hosts'] as $host) { |
|
| 93 | - $this->possibleOrigins[] = 'https://'.$host; |
|
| 92 | + foreach ($app[ 'hosts' ] as $host) { |
|
| 93 | + $this->possibleOrigins[ ] = 'https://'.$host; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |