@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Service; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Service; |
| 5 | 5 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function assembleUrl( |
| 37 | 37 | string $name = null, |
| 38 | - $routeParams = [], |
|
| 39 | - $queryParams = [], |
|
| 38 | + $routeParams = [ ], |
|
| 39 | + $queryParams = [ ], |
|
| 40 | 40 | bool $inherit = false |
| 41 | 41 | ): string { |
| 42 | 42 | $routeResult = $this->getCurrentRouteResult(); |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if (is_bool($routeParams)) { |
| 48 | 48 | $inherit = $routeParams; |
| 49 | - $routeParams = []; |
|
| 49 | + $routeParams = [ ]; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (is_bool($queryParams)) { |
| 53 | 53 | $inherit = $queryParams; |
| 54 | - $queryParams = []; |
|
| 54 | + $queryParams = [ ]; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | if ($inherit) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $queryString = empty($queryParams) ? '' : sprintf('?%s', http_build_query($queryParams)); |
| 63 | - return $this->router->generateUri($name, $routeParams) . $queryString; |
|
| 63 | + return $this->router->generateUri($name, $routeParams).$queryString; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\I18n; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Form; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Form; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Action; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Action; |
| 5 | 5 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @param array $viewParams |
| 32 | 32 | * @return HtmlResponse |
| 33 | 33 | */ |
| 34 | - protected function createTemplateResponse(Request $request, array $viewParams = []): HtmlResponse |
|
| 34 | + protected function createTemplateResponse(Request $request, array $viewParams = [ ]): HtmlResponse |
|
| 35 | 35 | { |
| 36 | 36 | $template = $request->getAttribute('template', self::NOT_FOUND_TEMPLATE); |
| 37 | 37 | $status = $template === self::NOT_FOUND_TEMPLATE ? self::STATUS_NOT_FOUND : self::STATUS_OK; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Action; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Acelaya\Website\Action; |
| 5 | 5 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | parent::__construct($renderer); |
| 39 | 39 | $this->contactService = $contactService; |
| 40 | 40 | $this->contactFilter = $contactFilter; |
| 41 | - $this->session= $session ?: new Container(__CLASS__); |
|
| 41 | + $this->session = $session ?: new Container(__CLASS__); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | public function dispatch(Request $request, DelegateInterface $delegate): Response |
| 52 | 52 | { |
| 53 | 53 | // On GET requests that are not comming from PRG, just return the template |
| 54 | - if ($request->getMethod() === self::METHOD_GET && ! $this->session->offsetExists(self::PRG_DATA)) { |
|
| 54 | + if ($request->getMethod() === self::METHOD_GET && !$this->session->offsetExists(self::PRG_DATA)) { |
|
| 55 | 55 | return $this->createTemplateResponse($request); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $this->session->offsetUnset(self::PRG_DATA); |
| 68 | 68 | $filter = $this->contactFilter; |
| 69 | 69 | $filter->setData($params); |
| 70 | - if (! $filter->isValid()) { |
|
| 70 | + if (!$filter->isValid()) { |
|
| 71 | 71 | return $this->createTemplateResponse($request, [ |
| 72 | 72 | 'errors' => $filter->getMessages(), |
| 73 | 73 | 'currentData' => $params, |
@@ -76,6 +76,6 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // If the form is valid, send the email |
| 78 | 78 | $result = $this->contactService->send($filter->getValues()); |
| 79 | - return $this->createTemplateResponse($request, $result ? ['success' => true] : ['errors' => []]); |
|
| 79 | + return $this->createTemplateResponse($request, $result ? [ 'success' => true ] : [ 'errors' => [ ] ]); |
|
| 80 | 80 | } |
| 81 | 81 | } |