Completed
Push — master ( ea1904...7857ce )
by Alejandro
08:41
created
src/Form/ContactFilter.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     }
40 40
 
41 41
     /**
42
-     * @param $name
42
+     * @param string $name
43 43
      * @param bool|true $required
44 44
      * @return Input
45 45
      */
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     {
48 48
         $input = new Input($name);
49 49
         $input->setRequired($required)
50
-              ->getFilterChain()->attach(new StripTags())
50
+                ->getFilterChain()->attach(new StripTags())
51 51
                                 ->attach(new StringTrim());
52 52
         return $input;
53 53
     }
Please login to merge, or discard this patch.
config/autoload/routes.global.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 $home = [
7 7
     'name' => 'home',
8 8
     'path' => '(/:lang)/',
9
-    'allowed_methods' => ['GET'],
9
+    'allowed_methods' => [ 'GET' ],
10 10
     'middleware' => Template::class,
11 11
     'options' => [
12 12
         'conditions' => [
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         ArrayUtils::merge($home, [
44 44
             'name' => 'contact',
45 45
             'path' => '(/:lang)/contact/',
46
-            'allowed_methods' => ['POST'],
46
+            'allowed_methods' => [ 'POST' ],
47 47
             'middleware' => Contact::class,
48 48
             'options' => [
49 49
                 'defaults' => [
Please login to merge, or discard this patch.
src/Twig/Extension/TranslatorExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
     public function getFunctions()
19 19
     {
20 20
         return [
21
-            new \Twig_SimpleFunction('translate', [$this, 'translate']),
22
-            new \Twig_SimpleFunction('translate_plural', [$this, 'translatePlural']),
23
-            new \Twig_SimpleFunction('locale', [$this, 'getLocale']),
21
+            new \Twig_SimpleFunction('translate', [ $this, 'translate' ]),
22
+            new \Twig_SimpleFunction('translate_plural', [ $this, 'translatePlural' ]),
23
+            new \Twig_SimpleFunction('locale', [ $this, 'getLocale' ]),
24 24
         ];
25 25
     }
26 26
 
Please login to merge, or discard this patch.
src/Service/ContactService.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@
 block discarded – undo
43 43
     private function createMessage(array $messageData)
44 44
     {
45 45
         return \Swift_Message::newInstance($this->options->getSubject())
46
-                             ->setTo($this->options->getTo())
47
-                             ->setFrom($this->options->getFrom())
48
-                             ->setReplyTo($messageData['email'])
49
-                             ->setBody($this->composeBody($messageData), 'text/html');
46
+                                ->setTo($this->options->getTo())
47
+                                ->setFrom($this->options->getFrom())
48
+                                ->setReplyTo($messageData['email'])
49
+                                ->setBody($this->composeBody($messageData), 'text/html');
50 50
     }
51 51
 
52 52
     private function composeBody(array $messageData)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         return \Swift_Message::newInstance($this->options->getSubject())
46 46
                              ->setTo($this->options->getTo())
47 47
                              ->setFrom($this->options->getFrom())
48
-                             ->setReplyTo($messageData['email'])
48
+                             ->setReplyTo($messageData[ 'email' ])
49 49
                              ->setBody($this->composeBody($messageData), 'text/html');
50 50
     }
51 51
 
Please login to merge, or discard this patch.
src/Factory/TranslatorFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __invoke(ContainerInterface $container)
10 10
     {
11
-        $translatorConfig = $container->get('config')['translator'];
11
+        $translatorConfig = $container->get('config')[ 'translator' ];
12 12
         return Translator::factory($translatorConfig);
13 13
     }
14 14
 }
Please login to merge, or discard this patch.
src/Factory/RecaptchaFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __invoke(ContainerInterface $container)
10 10
     {
11
-        $recaptchaConfig = $container->get('config')['recaptcha'];
12
-        return new ReCaptcha($recaptchaConfig['private_key']);
11
+        $recaptchaConfig = $container->get('config')[ 'recaptcha' ];
12
+        return new ReCaptcha($recaptchaConfig[ 'private_key' ]);
13 13
     }
14 14
 }
Please login to merge, or discard this patch.
src/Factory/SwiftMailerFactory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
         $mailConfig = $container->get('config')['mail'];
11 11
         $smtp = $mailConfig['smtp'];
12 12
         $transport = \Swift_SmtpTransport::newInstance($smtp['server'], $smtp['port'], $smtp['ssl'])
13
-                                         ->setUsername($smtp['username'])
14
-                                         ->setPassword($smtp['password']);
13
+                                            ->setUsername($smtp['username'])
14
+                                            ->setPassword($smtp['password']);
15 15
         return new \Swift_Mailer($transport);
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
 {
8 8
     public function __invoke(ContainerInterface $container)
9 9
     {
10
-        $mailConfig = $container->get('config')['mail'];
11
-        $smtp = $mailConfig['smtp'];
12
-        $transport = \Swift_SmtpTransport::newInstance($smtp['server'], $smtp['port'], $smtp['ssl'])
13
-                                         ->setUsername($smtp['username'])
14
-                                         ->setPassword($smtp['password']);
10
+        $mailConfig = $container->get('config')[ 'mail' ];
11
+        $smtp = $mailConfig[ 'smtp' ];
12
+        $transport = \Swift_SmtpTransport::newInstance($smtp[ 'server' ], $smtp[ 'port' ], $smtp[ 'ssl' ])
13
+                                         ->setUsername($smtp[ 'username' ])
14
+                                         ->setPassword($smtp[ 'password' ]);
15 15
         return new \Swift_Mailer($transport);
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Action/Contact.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         parent::__construct($renderer);
36 36
         $this->contactService = $contactService;
37 37
         $this->contactFilter = $contactFilter;
38
-        $this->session= $session ?: new Container(__CLASS__);
38
+        $this->session = $session ?: new Container(__CLASS__);
39 39
     }
40 40
 
41 41
     /**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function dispatch(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
50 50
     {
51 51
         // On GET requests that are not comming from PRG, just return the template
52
-        if ($request->getMethod() === 'GET' && ! $this->session->offsetExists(self::PRG_DATA)) {
52
+        if ($request->getMethod() === 'GET' && !$this->session->offsetExists(self::PRG_DATA)) {
53 53
             return $this->createTemplateResponse($request);
54 54
         }
55 55
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->session->offsetUnset(self::PRG_DATA);
66 66
         $filter = $this->contactFilter;
67 67
         $filter->setData($params);
68
-        if (! $filter->isValid()) {
68
+        if (!$filter->isValid()) {
69 69
             return $this->createTemplateResponse($request, [
70 70
                 'errors' => $filter->getMessages(),
71 71
                 'currentData' => $params
@@ -74,6 +74,6 @@  discard block
 block discarded – undo
74 74
 
75 75
         // If the form is valid, send the email
76 76
         $result = $this->contactService->send($filter->getValues());
77
-        return $this->createTemplateResponse($request, $result ? ['success' => true] : ['errors' => []]);
77
+        return $this->createTemplateResponse($request, $result ? [ 'success' => true ] : [ 'errors' => [ ] ]);
78 78
     }
79 79
 }
Please login to merge, or discard this patch.
src/Middleware/LanguageMiddleware.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
      * @param Request $request
56 56
      * @param Response $response
57 57
      * @param null|callable $out
58
-     * @return null|Response
58
+     * @return Response
59 59
      */
60 60
     public function __invoke(Request $request, Response $response, callable $out = null): Response
61 61
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         $params = $matchedRoute->getMatchedParams();
64 64
 
65 65
         // Determine the language to use based on the lang parameter
66
-        $lang = $params['lang'] ?? 'en';
66
+        $lang = $params[ 'lang' ] ?? 'en';
67 67
         $this->translator->setLocale($lang);
68 68
         return $out($request, $response);
69 69
     }
Please login to merge, or discard this patch.