@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | [ |
20 | 20 | 'name' => 'title', |
21 | 21 | 'required' => true, |
22 | - 'filters' => [['name' => 'StringTrim']], |
|
22 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
23 | 23 | 'validators' => [ |
24 | - ['name' => 'NotEmpty'], |
|
25 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 100]], |
|
24 | + [ 'name' => 'NotEmpty' ], |
|
25 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 100 ] ], |
|
26 | 26 | ], |
27 | 27 | ] |
28 | 28 | ); |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | [ |
32 | 32 | 'name' => 'body', |
33 | 33 | 'required' => true, |
34 | - 'filters' => [['name' => 'StringTrim']], |
|
34 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
35 | 35 | 'validators' => [ |
36 | - ['name' => 'NotEmpty'], |
|
37 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 1500]], |
|
36 | + [ 'name' => 'NotEmpty' ], |
|
37 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 1500 ] ], |
|
38 | 38 | ], |
39 | 39 | ] |
40 | 40 | ); |
@@ -20,8 +20,8 @@ |
||
20 | 20 | */ |
21 | 21 | public function __invoke(ContainerInterface $container): VideoService |
22 | 22 | { |
23 | - $config = $container->get('config')['upload']; |
|
24 | - $upload = new Upload($config['public_path'], $config['non_public_path']); |
|
23 | + $config = $container->get('config')[ 'upload' ]; |
|
24 | + $upload = new Upload($config[ 'public_path' ], $config[ 'non_public_path' ]); |
|
25 | 25 | |
26 | 26 | return new VideoService( |
27 | 27 | $container->get(ArticleMapper::class), |
@@ -20,8 +20,8 @@ |
||
20 | 20 | */ |
21 | 21 | public function __invoke(ContainerInterface $container): PostService |
22 | 22 | { |
23 | - $config = $container->get('config')['upload']; |
|
24 | - $upload = new Upload($config['public_path'], $config['non_public_path']); |
|
23 | + $config = $container->get('config')[ 'upload' ]; |
|
24 | + $upload = new Upload($config[ 'public_path' ], $config[ 'non_public_path' ]); |
|
25 | 25 | |
26 | 26 | return new PostService( |
27 | 27 | $container->get(ArticleMapper::class), |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Newsletter\Web\Action; |
4 | 4 | |
5 | 5 | use Psr\Http\Message\ResponseInterface as Response; |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | { |
21 | 21 | try { |
22 | 22 | $data = $request->getParsedBody(); |
23 | - $email = isset($data['email']) ? $data['email'] : null; |
|
23 | + $email = isset($data[ 'email' ]) ? $data[ 'email' ] : null; |
|
24 | 24 | |
25 | 25 | $this->newsletterService->registerNew($email); |
26 | 26 | |
27 | - return new JsonResponse(['message' => 'Uspešno ste se prijavili.']); |
|
27 | + return new JsonResponse([ 'message' => 'Uspešno ste se prijavili.' ]); |
|
28 | 28 | } catch (\Exception $e) { |
29 | - return new JsonResponse(['message' => $e->getMessage()], $e->getCode()); |
|
29 | + return new JsonResponse([ 'message' => $e->getMessage() ], $e->getCode()); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Newsletter\Service; |
4 | 4 | |
5 | 5 | use Newsletter\Mapper\NewsletterMapper; |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | throw new \Exception('Email is not valid!', 400); |
20 | 20 | } |
21 | 21 | |
22 | - $current = $this->newsletterMapper->select(['email' => $email])->current(); |
|
22 | + $current = $this->newsletterMapper->select([ 'email' => $email ])->current(); |
|
23 | 23 | |
24 | 24 | if (!$current) { |
25 | - return $this->newsletterMapper->insert(['email' => $email]); |
|
25 | + return $this->newsletterMapper->insert([ 'email' => $email ]); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Page; |
4 | 4 | |
5 | 5 | use Zend\ServiceManager\Factory\InvokableFactory; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | 'page/pagination' => __DIR__ . '/../templates/partial/pagination.php', |
15 | 15 | ], |
16 | 16 | 'paths' => [ |
17 | - 'page' => [__DIR__ . '/../templates/page'], |
|
17 | + 'page' => [ __DIR__ . '/../templates/page' ], |
|
18 | 18 | ], |
19 | 19 | ], |
20 | 20 | |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | 'name' => 'admin.pages', |
33 | 33 | 'path' => '/admin/pages', |
34 | 34 | 'middleware' => Controller\PageController::class, |
35 | - 'allowed_methods' => ['GET'], |
|
35 | + 'allowed_methods' => [ 'GET' ], |
|
36 | 36 | ], |
37 | 37 | [ |
38 | 38 | 'name' => 'admin.pages.action', |
39 | 39 | 'path' => '/admin/pages/:action/:id', |
40 | 40 | 'middleware' => Controller\PageController::class, |
41 | - 'allowed_methods' => ['GET', 'POST'] |
|
41 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
42 | 42 | ] |
43 | 43 | ], |
44 | 44 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Page\Mapper; |
4 | 4 | |
5 | 5 | use Page\Entity\Page; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Page\Controller; |
4 | 4 | |
5 | 5 | use Interop\Container\ContainerInterface; |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | public function index(): HtmlResponse |
48 | 48 | { |
49 | 49 | $params = $this->request->getQueryParams(); |
50 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
51 | - $limit = isset($params['limit']) ? $params['limit'] : 15; |
|
50 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
51 | + $limit = isset($params[ 'limit' ]) ? $params[ 'limit' ] : 15; |
|
52 | 52 | $pagination = $this->pageService->getPagination($page, $limit); |
53 | 53 | |
54 | 54 | return new HtmlResponse( |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | ); |
62 | 62 | } |
63 | 63 | |
64 | - public function edit($errors = []): HtmlResponse |
|
64 | + public function edit($errors = [ ]): HtmlResponse |
|
65 | 65 | { |
66 | 66 | $id = $this->request->getAttribute('id'); |
67 | 67 | $page = $this->pageService->getPage($id); |
68 | 68 | |
69 | 69 | if ($this->request->getParsedBody()) { |
70 | 70 | $page = new \Page\Entity\Page(); |
71 | - $page->exchangeArray($this->request->getParsedBody() + (array)$page); |
|
71 | + $page->exchangeArray($this->request->getParsedBody() + (array) $page); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return new HtmlResponse( |