@@ -39,7 +39,7 @@ |
||
| 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 | */ |
@@ -47,7 +47,7 @@ |
||
| 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 | } |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Acelaya\Website\Form; |
| 3 | 3 | |
| 4 | -use ReCaptcha\ReCaptcha; |
|
| 5 | 4 | use Zend\Validator\AbstractValidator; |
| 6 | 5 | use Zend\Validator\Exception; |
| 7 | 6 | |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Acelaya\Website\Form; |
| 3 | 3 | |
| 4 | -use ReCaptcha\ReCaptcha; |
|
| 5 | 4 | use Zend\Validator\AbstractValidator; |
| 6 | 5 | use Zend\Validator\Exception; |
| 7 | 6 | |
@@ -6,7 +6,7 @@ discard block |
||
| 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 |
||
| 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' => [ |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | if (class_exists(Dotenv::class)) { |
| 15 | 15 | $dotenv = new Dotenv(__DIR__ . '/..'); |
| 16 | 16 | $dotenv->load(); |
| 17 | - $dotenv->required('APP_ENV')->allowedValues(['pro', 'dev']); |
|
| 17 | + $dotenv->required('APP_ENV')->allowedValues([ 'pro', 'dev' ]); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // Set error reporting |
@@ -76,10 +76,10 @@ |
||
| 76 | 76 | * @param array $routeParams |
| 77 | 77 | * @return bool |
| 78 | 78 | */ |
| 79 | - protected function isResponseCacheable(Response $resp, array $routeParams = []) |
|
| 79 | + protected function isResponseCacheable(Response $resp, array $routeParams = [ ]) |
|
| 80 | 80 | { |
| 81 | 81 | return $resp->getStatusCode() === 200 |
| 82 | - && isset($routeParams['cacheable']) |
|
| 83 | - && $routeParams['cacheable'] === true; |
|
| 82 | + && isset($routeParams[ 'cacheable' ]) |
|
| 83 | + && $routeParams[ 'cacheable' ] === true; |
|
| 84 | 84 | } |
| 85 | 85 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $params = $matchedRoute->getMatchedParams(); |
| 56 | 56 | |
| 57 | 57 | // Determine the language to use based on the lang parameter |
| 58 | - $lang = isset($params['lang']) ? $params['lang'] : 'en'; |
|
| 58 | + $lang = isset($params[ 'lang' ]) ? $params[ 'lang' ] : 'en'; |
|
| 59 | 59 | $this->translator->setLocale($lang); |
| 60 | 60 | return $out($request, $response); |
| 61 | 61 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * @param array $viewParams |
| 30 | 30 | * @return HtmlResponse |
| 31 | 31 | */ |
| 32 | - protected function createTemplateResponse(ServerRequestInterface $request, array $viewParams = []) |
|
| 32 | + protected function createTemplateResponse(ServerRequestInterface $request, array $viewParams = [ ]) |
|
| 33 | 33 | { |
| 34 | 34 | $template = $request->getAttribute('template', self::NOT_FOUND_TEMPLATE); |
| 35 | 35 | $status = $template === self::NOT_FOUND_TEMPLATE ? 404 : 200; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function getFunctions() |
| 20 | 20 | { |
| 21 | 21 | return [ |
| 22 | - new \Twig_SimpleFunction('assemble_url', [$this, 'assembleUrl']) |
|
| 22 | + new \Twig_SimpleFunction('assemble_url', [ $this, 'assembleUrl' ]) |
|
| 23 | 23 | ]; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param bool|true $inherit |
| 31 | 31 | * @return string |
| 32 | 32 | */ |
| 33 | - public function assembleUrl($name = null, $routeParams = [], $queryParams = [], $inherit = false) |
|
| 33 | + public function assembleUrl($name = null, $routeParams = [ ], $queryParams = [ ], $inherit = false) |
|
| 34 | 34 | { |
| 35 | 35 | return $this->routeAssembler->assembleUrl($name, $routeParams, $queryParams, $inherit); |
| 36 | 36 | } |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | public function getFunctions() |
| 14 | 14 | { |
| 15 | 15 | return [ |
| 16 | - new \Twig_SimpleFunction('recaptcha_public', [$this, 'getRecapcthaPublicKey']), |
|
| 17 | - new \Twig_SimpleFunction('recaptcha_input', [$this, 'renderInput'], ['is_safe' => ['html']]), |
|
| 16 | + new \Twig_SimpleFunction('recaptcha_public', [ $this, 'getRecapcthaPublicKey' ]), |
|
| 17 | + new \Twig_SimpleFunction('recaptcha_input', [ $this, 'renderInput' ], [ 'is_safe' => [ 'html' ] ]), |
|
| 18 | 18 | ]; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function getRecapcthaPublicKey() |
| 22 | 22 | { |
| 23 | - return $this->config['public_key']; |
|
| 23 | + return $this->config[ 'public_key' ]; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function renderInput($lang = 'en') |