@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | [ |
19 | 19 | 'name' => 'title', |
20 | 20 | 'required' => true, |
21 | - 'filters' => [['name' => 'StringTrim']], |
|
21 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
22 | 22 | 'validators' => [ |
23 | - ['name' => 'NotEmpty'], |
|
24 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 100]], |
|
23 | + [ 'name' => 'NotEmpty' ], |
|
24 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 100 ] ], |
|
25 | 25 | ], |
26 | 26 | ] |
27 | 27 | ); |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | [ |
31 | 31 | 'name' => 'slug', |
32 | 32 | 'required' => true, |
33 | - 'filters' => [['name' => 'StringTrim']], |
|
33 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
34 | 34 | 'validators' => [ |
35 | - ['name' => 'NotEmpty'], |
|
36 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 100]], |
|
35 | + [ 'name' => 'NotEmpty' ], |
|
36 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 100 ] ], |
|
37 | 37 | ], |
38 | 38 | ] |
39 | 39 | ); |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | [ |
43 | 43 | 'name' => 'body', |
44 | 44 | 'required' => true, |
45 | - 'filters' => [['name' => 'StringTrim']], |
|
45 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
46 | 46 | 'validators' => [ |
47 | - ['name' => 'NotEmpty'], |
|
48 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 100000]], |
|
47 | + [ 'name' => 'NotEmpty' ], |
|
48 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 100000 ] ], |
|
49 | 49 | ], |
50 | 50 | ] |
51 | 51 | ); |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | [ |
55 | 55 | 'name' => 'description', |
56 | 56 | 'required' => true, |
57 | - 'filters' => [['name' => 'StringTrim']], |
|
57 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
58 | 58 | 'validators' => [ |
59 | - ['name' => 'NotEmpty'], |
|
60 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 50000]], |
|
59 | + [ 'name' => 'NotEmpty' ], |
|
60 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 50000 ] ], |
|
61 | 61 | ], |
62 | 62 | ] |
63 | 63 | ); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | [ |
67 | 67 | 'name' => 'has_layout', |
68 | 68 | 'required' => false, |
69 | - 'filters' => [['name' => 'Boolean']], |
|
69 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
70 | 70 | ] |
71 | 71 | ); |
72 | 72 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | [ |
75 | 75 | 'name' => 'is_homepage', |
76 | 76 | 'required' => false, |
77 | - 'filters' => [['name' => 'Boolean']], |
|
77 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
78 | 78 | ] |
79 | 79 | ); |
80 | 80 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | [ |
83 | 83 | 'name' => 'is_active', |
84 | 84 | 'required' => false, |
85 | - 'filters' => [['name' => 'Boolean']], |
|
85 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
86 | 86 | ] |
87 | 87 | ); |
88 | 88 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | [ |
91 | 91 | 'name' => 'is_wysiwyg_editor', |
92 | 92 | 'required' => false, |
93 | - 'filters' => [['name' => 'Boolean']], |
|
93 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
94 | 94 | ] |
95 | 95 | ); |
96 | 96 |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | </div> |
8 | 8 | </div> |
9 | 9 | <div class="col-sm-7"> |
10 | - <?php if($this->pageCount > 1) : ?> |
|
10 | + <?php if ($this->pageCount > 1) : ?> |
|
11 | 11 | <div class="pull-right"> |
12 | 12 | <ul class="pagination" style="margin:0px;"> |
13 | 13 | <!-- Previous page link --> |
14 | - <?php if(isset($this->previous)) : ?> |
|
14 | + <?php if (isset($this->previous)) : ?> |
|
15 | 15 | <li> |
16 | - <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $this->previous; ?>"> |
|
16 | + <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $this->previous; ?>"> |
|
17 | 17 | <span class="glyphicon glyphicon-chevron-left"></span> |
18 | 18 | </a> |
19 | 19 | </li> |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | <?php endif; ?> |
27 | 27 | |
28 | 28 | <!-- Numbered page links --> |
29 | - <?php foreach($this->pagesInRange as $page): ?> |
|
30 | - <?php if($page != $this->current) : ?> |
|
29 | + <?php foreach ($this->pagesInRange as $page): ?> |
|
30 | + <?php if ($page != $this->current) : ?> |
|
31 | 31 | <li> |
32 | - <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $page; ?>"> |
|
32 | + <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $page; ?>"> |
|
33 | 33 | <?php echo $page; ?> |
34 | 34 | </a> |
35 | 35 | </li> |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | <?php endforeach; ?> |
42 | 42 | |
43 | 43 | <!-- Next page link --> |
44 | - <?php if(isset($this->next)) : ?> |
|
44 | + <?php if (isset($this->next)) : ?> |
|
45 | 45 | <li> |
46 | - <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $this->next; ?>"> |
|
46 | + <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $this->next; ?>"> |
|
47 | 47 | <span class="glyphicon glyphicon-chevron-right"></span> |
48 | 48 | </a> |
49 | 49 | </li> |
@@ -14,8 +14,8 @@ |
||
14 | 14 | public function __invoke(ContainerInterface $container) |
15 | 15 | { |
16 | 16 | |
17 | - $config = $container->get('config')['upload']; |
|
18 | - $upload = new Upload($config['public_path'], $config['non_public_path']); |
|
17 | + $config = $container->get('config')[ 'upload' ]; |
|
18 | + $upload = new Upload($config[ 'public_path' ], $config[ 'non_public_path' ]); |
|
19 | 19 | |
20 | 20 | // Create pagination object |
21 | 21 | $pageMapper = $container->get(PageMapper::class); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | if (!$user) { |
55 | 55 | return $response->withStatus(302)->withHeader( |
56 | 56 | 'Location', |
57 | - $this->router->generateUri('auth', ['action' => 'login']) |
|
57 | + $this->router->generateUri('auth', [ 'action' => 'login' ]) |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Admin\Factory\Service; |
6 | 6 | |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __invoke(ContainerInterface $container): AdminUserService |
23 | 23 | { |
24 | - $config = $container->get('config')['upload']; |
|
25 | - $upload = new Upload($config['public_path'], $config['non_public_path']); |
|
24 | + $config = $container->get('config')[ 'upload' ]; |
|
25 | + $upload = new Upload($config[ 'public_path' ], $config[ 'non_public_path' ]); |
|
26 | 26 | |
27 | 27 | return new AdminUserService( |
28 | 28 | new Bcrypt(), |
@@ -10,7 +10,7 @@ |
||
10 | 10 | ->disableOriginalConstructor() |
11 | 11 | ->getMockForAbstractClass(); |
12 | 12 | $container = $this->getMockBuilder(\Interop\Container\ContainerInterface::class) |
13 | - ->setMethods(['get']) |
|
13 | + ->setMethods([ 'get' ]) |
|
14 | 14 | ->getMockForAbstractClass(); |
15 | 15 | $container->expects(static::at(0)) |
16 | 16 | ->method('get') |
@@ -16,26 +16,26 @@ |
||
16 | 16 | public function testForSelectShouldReturnArray() |
17 | 17 | { |
18 | 18 | $categoryService = $this->getMockBuilder(\Category\Service\CategoryService::class) |
19 | - ->setMethods(['getAll']) |
|
19 | + ->setMethods([ 'getAll' ]) |
|
20 | 20 | ->disableOriginalConstructor() |
21 | 21 | ->getMockForAbstractClass(); |
22 | 22 | $categoryService->expects(static::once()) |
23 | 23 | ->method('getAll') |
24 | - ->willReturn([]); |
|
24 | + ->willReturn([ ]); |
|
25 | 25 | $categoryHelper = new \Category\View\Helper\CategoryHelper($categoryService); |
26 | - static::assertSame([], $categoryHelper->forSelect()); |
|
26 | + static::assertSame([ ], $categoryHelper->forSelect()); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testForHomepageShouldReturnArray() |
30 | 30 | { |
31 | 31 | $categoryService = $this->getMockBuilder(\Category\Service\CategoryService::class) |
32 | - ->setMethods(['getCategoriesWithPosts']) |
|
32 | + ->setMethods([ 'getCategoriesWithPosts' ]) |
|
33 | 33 | ->disableOriginalConstructor() |
34 | 34 | ->getMockForAbstractClass(); |
35 | 35 | $categoryService->expects(static::once()) |
36 | 36 | ->method('getCategoriesWithPosts') |
37 | - ->willReturn([]); |
|
37 | + ->willReturn([ ]); |
|
38 | 38 | $categoryHelper = new \Category\View\Helper\CategoryHelper($categoryService); |
39 | - static::assertSame([], $categoryHelper->forHomepage()); |
|
39 | + static::assertSame([ ], $categoryHelper->forHomepage()); |
|
40 | 40 | } |
41 | 41 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | ->disableOriginalConstructor() |
11 | 11 | ->getMockForAbstractClass(); |
12 | 12 | $container = $this->getMockBuilder(\Interop\Container\ContainerInterface::class) |
13 | - ->setMethods(['get']) |
|
13 | + ->setMethods([ 'get' ]) |
|
14 | 14 | ->getMockForAbstractClass(); |
15 | 15 | $container->expects(static::at(0)) |
16 | 16 | ->method('get') |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | public function testIndexMethodShouldReturnHtmlResponse() |
8 | 8 | { |
9 | 9 | $template = $this->getMockBuilder(\Zend\Expressive\Template\TemplateRendererInterface::class) |
10 | - ->setMethods(['render']) |
|
10 | + ->setMethods([ 'render' ]) |
|
11 | 11 | ->getMockForAbstractClass(); |
12 | 12 | $template->expects(static::once()) |
13 | 13 | ->method('render') |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function testEditMethodShouldReturnHtmlResponseAndGetIdFromRequest() |
32 | 32 | { |
33 | 33 | $template = $this->getMockBuilder(\Zend\Expressive\Template\TemplateRendererInterface::class) |
34 | - ->setMethods(['render']) |
|
34 | + ->setMethods([ 'render' ]) |
|
35 | 35 | ->getMockForAbstractClass(); |
36 | 36 | $template->expects(static::once()) |
37 | 37 | ->method('render') |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $request = new \Zend\Diactoros\ServerRequest(); |
45 | 45 | $request = $request->withAttribute('action', 'edit'); |
46 | 46 | $request = $request->withAttribute('id', 1); |
47 | - $request = $request->withParsedBody(['menu' => 'test']); |
|
47 | + $request = $request->withParsedBody([ 'menu' => 'test' ]); |
|
48 | 48 | $response = new \Zend\Diactoros\Response(); |
49 | 49 | $indexController = new \Menu\Controller\IndexController( |
50 | 50 | $template, |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ->will(static::returnValue('http://unfinished.dev/admin')); |
69 | 69 | $request = new \Zend\Diactoros\ServerRequest(); |
70 | 70 | $request = $request->withAttribute('action', 'save'); |
71 | - $request = $request->withParsedBody(['menu' => 'test']); |
|
71 | + $request = $request->withParsedBody([ 'menu' => 'test' ]); |
|
72 | 72 | $response = new \Zend\Diactoros\Response(); |
73 | 73 | $indexController = new \Menu\Controller\IndexController( |
74 | 74 | $template, |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $request = new \Zend\Diactoros\ServerRequest(); |
95 | 95 | $request = $request->withAttribute('action', 'save'); |
96 | 96 | $request = $request->withAttribute('id', 1); |
97 | - $request = $request->withParsedBody(['menu' => 'test']); |
|
97 | + $request = $request->withParsedBody([ 'menu' => 'test' ]); |
|
98 | 98 | $response = new \Zend\Diactoros\Response(); |
99 | 99 | $indexController = new \Menu\Controller\IndexController( |
100 | 100 | $template, |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | ->getMock(); |
118 | 118 | $menuService->expects(static::once()) |
119 | 119 | ->method('updateMenuItem') |
120 | - ->willThrowException(new \Std\FilterException(['test error'])); |
|
120 | + ->willThrowException(new \Std\FilterException([ 'test error' ])); |
|
121 | 121 | $router = $this->getMockBuilder(\Zend\Expressive\Router\RouterInterface::class) |
122 | 122 | ->getMockForAbstractClass(); |
123 | 123 | $request = new \Zend\Diactoros\ServerRequest(); |
124 | 124 | $request = $request->withAttribute('action', 'save'); |
125 | 125 | $request = $request->withAttribute('id', 2); |
126 | - $request = $request->withParsedBody(['menu' => 'test']); |
|
126 | + $request = $request->withParsedBody([ 'menu' => 'test' ]); |
|
127 | 127 | $response = new \Zend\Diactoros\Response(); |
128 | 128 | $indexController = new \Menu\Controller\IndexController( |
129 | 129 | $template, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $request = new \Zend\Diactoros\ServerRequest(); |
156 | 156 | $request = $request->withAttribute('action', 'save'); |
157 | 157 | $request = $request->withAttribute('id', 2); |
158 | - $request = $request->withParsedBody(['menu' => 'test']); |
|
158 | + $request = $request->withParsedBody([ 'menu' => 'test' ]); |
|
159 | 159 | $response = new \Zend\Diactoros\Response(); |
160 | 160 | $indexController = new \Menu\Controller\IndexController( |
161 | 161 | $template, |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $request = new \Zend\Diactoros\ServerRequest(); |
235 | 235 | $request = $request->withAttribute('action', 'updateOrder'); |
236 | 236 | $request = $request->withAttribute('id', 2); |
237 | - $request = $request->withParsedBody(['menu' => 'test']); |
|
237 | + $request = $request->withParsedBody([ 'menu' => 'test' ]); |
|
238 | 238 | $response = new \Zend\Diactoros\Response(); |
239 | 239 | $indexController = new \Menu\Controller\IndexController( |
240 | 240 | $template, |