@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | /** |
148 | 148 | * |
149 | 149 | * |
150 | - * @var \Zend\Diactoros\Response $returnedResponse |
|
150 | + * @var \Zend\Diactoros\Response $returnedResponse |
|
151 | 151 | */ |
152 | 152 | $returnedResponse = $userController($request, $response); |
153 | 153 | static::assertSame(302, $returnedResponse->getStatusCode()); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | /** |
187 | 187 | * |
188 | 188 | * |
189 | - * @var \Zend\Diactoros\Response $returnedResponse |
|
189 | + * @var \Zend\Diactoros\Response $returnedResponse |
|
190 | 190 | */ |
191 | 191 | $returnedResponse = $userController($request, $response); |
192 | 192 | static::assertSame(302, $returnedResponse->getStatusCode()); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | /** |
229 | 229 | * |
230 | 230 | * |
231 | - * @var \Zend\Diactoros\Response $returnedResponse |
|
231 | + * @var \Zend\Diactoros\Response $returnedResponse |
|
232 | 232 | */ |
233 | 233 | $returnedResponse = $userController($request, $response); |
234 | 234 | static::assertSame(200, $returnedResponse->getStatusCode()); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | /** |
304 | 304 | * |
305 | 305 | * |
306 | - * @var \Zend\Diactoros\Response $returnedResponse |
|
306 | + * @var \Zend\Diactoros\Response $returnedResponse |
|
307 | 307 | */ |
308 | 308 | $returnedResponse = $userController($request, $response); |
309 | 309 | static::assertSame(302, $returnedResponse->getStatusCode()); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | /** |
346 | 346 | * |
347 | 347 | * |
348 | - * @var \Zend\Diactoros\Response $returnedResponse |
|
348 | + * @var \Zend\Diactoros\Response $returnedResponse |
|
349 | 349 | */ |
350 | 350 | $returnedResponse = $userController($request, $response); |
351 | 351 | static::assertSame(302, $returnedResponse->getStatusCode()); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $sessionStorage = new \Zend\Session\Storage\ArrayStorage(); |
14 | 14 | $sessionStorage->user = $user; |
15 | 15 | $template = $this->getMockBuilder(\Zend\Expressive\Template\TemplateRendererInterface::class) |
16 | - ->setMethods(['render']) |
|
16 | + ->setMethods([ 'render' ]) |
|
17 | 17 | ->getMockForAbstractClass(); |
18 | 18 | $template->expects(static::once()) |
19 | 19 | ->method('render') |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | ->getMock(); |
24 | 24 | $sessionManager = $this->getMockBuilder(\Zend\Session\SessionManager::class) |
25 | 25 | ->disableOriginalConstructor() |
26 | - ->setMethods(['getStorage']) |
|
26 | + ->setMethods([ 'getStorage' ]) |
|
27 | 27 | ->getMock(); |
28 | 28 | $sessionManager->expects(static::any()) |
29 | 29 | ->method('getStorage') |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | $sessionStorage = new \Zend\Session\Storage\ArrayStorage(); |
50 | 50 | $sessionStorage->user = $user; |
51 | 51 | $template = $this->getMockBuilder(\Zend\Expressive\Template\TemplateRendererInterface::class) |
52 | - ->setMethods(['render']) |
|
52 | + ->setMethods([ 'render' ]) |
|
53 | 53 | ->getMockForAbstractClass(); |
54 | 54 | $template->expects(static::once()) |
55 | 55 | ->method('render') |
56 | 56 | ->will(static::returnValue('test')); |
57 | 57 | $adminUserService = $this->getMockBuilder(\Admin\Service\AdminUserService::class) |
58 | 58 | ->disableOriginalConstructor() |
59 | - ->setMethods(['getUser']) |
|
59 | + ->setMethods([ 'getUser' ]) |
|
60 | 60 | ->getMock(); |
61 | 61 | $adminUserService->expects(static::once()) |
62 | 62 | ->method('getUser') |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | $sessionStorage = new \Zend\Session\Storage\ArrayStorage(); |
87 | 87 | $sessionStorage->user = $user; |
88 | 88 | $template = $this->getMockBuilder(\Zend\Expressive\Template\TemplateRendererInterface::class) |
89 | - ->setMethods(['render']) |
|
89 | + ->setMethods([ 'render' ]) |
|
90 | 90 | ->getMockForAbstractClass(); |
91 | 91 | $template->expects(static::once()) |
92 | 92 | ->method('render') |
93 | 93 | ->will(static::returnValue('test')); |
94 | 94 | $adminUserService = $this->getMockBuilder(\Admin\Service\AdminUserService::class) |
95 | 95 | ->disableOriginalConstructor() |
96 | - ->setMethods(['getUser']) |
|
96 | + ->setMethods([ 'getUser' ]) |
|
97 | 97 | ->getMock(); |
98 | 98 | $adminUserService->expects(static::once()) |
99 | 99 | ->method('getUser') |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $request = new \Zend\Diactoros\ServerRequest(); |
107 | 107 | $request = $request->withAttribute('action', 'edit'); |
108 | 108 | $request = $request->withAttribute('id', 1); |
109 | - $request = $request->withParsedBody(['user' => 'test']); |
|
109 | + $request = $request->withParsedBody([ 'user' => 'test' ]); |
|
110 | 110 | $response = new \Zend\Diactoros\Response(); |
111 | 111 | $userController = new \Admin\Controller\UserController( |
112 | 112 | $template, |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ->will(static::returnValue('http://unfinished.dev/admin/users')); |
139 | 139 | $request = new \Zend\Diactoros\ServerRequest(); |
140 | 140 | $request = $request->withAttribute('action', 'save'); |
141 | - $request = $request->withParsedBody(['user' => 'test']); |
|
141 | + $request = $request->withParsedBody([ 'user' => 'test' ]); |
|
142 | 142 | $response = new \Zend\Diactoros\Response(); |
143 | 143 | $userController = new \Admin\Controller\UserController( |
144 | 144 | $template, |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $request = new \Zend\Diactoros\ServerRequest(); |
178 | 178 | $request = $request->withAttribute('action', 'save'); |
179 | 179 | $request = $request->withAttribute('id', 2); |
180 | - $request = $request->withParsedBody(['user' => 'test']); |
|
180 | + $request = $request->withParsedBody([ 'user' => 'test' ]); |
|
181 | 181 | $response = new \Zend\Diactoros\Response(); |
182 | 182 | $userController = new \Admin\Controller\UserController( |
183 | 183 | $template, |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | ->getMockForAbstractClass(); |
216 | 216 | $router->expects(static::at(0)) |
217 | 217 | ->method('generateUri') |
218 | - ->willThrowException(new \Std\FilterException(['test error'])); |
|
218 | + ->willThrowException(new \Std\FilterException([ 'test error' ])); |
|
219 | 219 | $request = new \Zend\Diactoros\ServerRequest(); |
220 | 220 | $request = $request->withAttribute('action', 'save'); |
221 | 221 | $request = $request->withAttribute('id', 2); |
222 | - $request = $request->withParsedBody(['user' => 'test']); |
|
222 | + $request = $request->withParsedBody([ 'user' => 'test' ]); |
|
223 | 223 | $response = new \Zend\Diactoros\Response(); |
224 | 224 | $userController = new \Admin\Controller\UserController( |
225 | 225 | $template, |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | ->willThrowException(new \Exception('test error')); |
263 | 263 | $request = new \Zend\Diactoros\ServerRequest(); |
264 | 264 | $request = $request->withAttribute('action', 'save'); |
265 | - $request = $request->withParsedBody(['user' => 'test']); |
|
265 | + $request = $request->withParsedBody([ 'user' => 'test' ]); |
|
266 | 266 | $response = new \Zend\Diactoros\Response(); |
267 | 267 | $userController = new \Admin\Controller\UserController( |
268 | 268 | $template, |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $template = $this->getMockBuilder(\Zend\Expressive\Template\TemplateRendererInterface::class) |
321 | 321 | ->getMockForAbstractClass(); |
322 | 322 | $adminUserService = $this->getMockBuilder(\Admin\Service\AdminUserService::class) |
323 | - ->setMethods(['delete']) |
|
323 | + ->setMethods([ 'delete' ]) |
|
324 | 324 | ->disableOriginalConstructor() |
325 | 325 | ->getMock(); |
326 | 326 | $adminUserService->expects(static::once()) |
@@ -35,6 +35,6 @@ |
||
35 | 35 | |
36 | 36 | public function getActivePage($urlSlug) |
37 | 37 | { |
38 | - return $this->select(['slug' => $urlSlug, 'is_active' => true]); |
|
38 | + return $this->select([ 'slug' => $urlSlug, 'is_active' => true ]); |
|
39 | 39 | } |
40 | 40 | } |
@@ -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 |
@@ -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); |
@@ -31,6 +31,9 @@ discard block |
||
31 | 31 | $this->adapter = $adapter; |
32 | 32 | } |
33 | 33 | |
34 | + /** |
|
35 | + * @param string $id |
|
36 | + */ |
|
34 | 37 | public function get($id) |
35 | 38 | { |
36 | 39 | return $this->select(['admin_user_id' => $id])->current(); |
@@ -40,7 +43,7 @@ discard block |
||
40 | 43 | * Get admin user by email. |
41 | 44 | * |
42 | 45 | * @param string $email email |
43 | - * @return array|\ArrayObject|null |
|
46 | + * @return string |
|
44 | 47 | */ |
45 | 48 | public function getByEmail(string $email) |
46 | 49 | { |
@@ -50,7 +53,6 @@ discard block |
||
50 | 53 | /** |
51 | 54 | * Updates login data. |
52 | 55 | * |
53 | - * @param string $uuid admin user id |
|
54 | 56 | * @return int number of affected rows |
55 | 57 | */ |
56 | 58 | public function updateLogin(string $userId): int |
@@ -58,6 +60,11 @@ discard block |
||
58 | 60 | return $this->update(['last_login' => date('Y-m-d H:i:s')], ['admin_user_id' => $userId]); |
59 | 61 | } |
60 | 62 | |
63 | + /** |
|
64 | + * @param string $userId |
|
65 | + * |
|
66 | + * @return \Zend\Db\Sql\Select |
|
67 | + */ |
|
61 | 68 | public function getPaginationSelect($userId) |
62 | 69 | { |
63 | 70 | $select = $this->getSql()->select()->order(['created_at' => 'desc']); |
@@ -67,6 +74,9 @@ discard block |
||
67 | 74 | return $select; |
68 | 75 | } |
69 | 76 | |
77 | + /** |
|
78 | + * @param integer $limit |
|
79 | + */ |
|
70 | 80 | public function getRandom($limit) |
71 | 81 | { |
72 | 82 | $select = $this->getSql()->select() |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function get($id) |
34 | 34 | { |
35 | - return $this->select(['admin_user_id' => $id])->current(); |
|
35 | + return $this->select([ 'admin_user_id' => $id ])->current(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function getByEmail(string $email) |
45 | 45 | { |
46 | - return $this->select(['email' => $email])->current(); |
|
46 | + return $this->select([ 'email' => $email ])->current(); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function updateLogin(string $userId): int |
56 | 56 | { |
57 | - return $this->update(['last_login' => date('Y-m-d H:i:s')], ['admin_user_id' => $userId]); |
|
57 | + return $this->update([ 'last_login' => date('Y-m-d H:i:s') ], [ 'admin_user_id' => $userId ]); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function getPaginationSelect($userId) |
61 | 61 | { |
62 | - $select = $this->getSql()->select()->order(['created_at' => 'desc']); |
|
62 | + $select = $this->getSql()->select()->order([ 'created_at' => 'desc' ]); |
|
63 | 63 | |
64 | 64 | $select->where->notEqualTo('admin_user_id', $userId); |
65 | 65 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function getRandom($limit) |
70 | 70 | { |
71 | 71 | $select = $this->getSql()->select() |
72 | - ->where(['status' => 1]) |
|
72 | + ->where([ 'status' => 1 ]) |
|
73 | 73 | ->order(new Expression('rand()')) |
74 | 74 | ->limit($limit); |
75 | 75 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | public function getUuid($adminUserId) |
80 | 80 | { |
81 | - $user = $this->select(['admin_user_id' => $adminUserId])->current(); |
|
81 | + $user = $this->select([ 'admin_user_id' => $adminUserId ])->current(); |
|
82 | 82 | |
83 | 83 | if (!$user) { |
84 | 84 | throw new \Exception('Admin user does not exist!', 400); |
@@ -33,6 +33,9 @@ |
||
33 | 33 | $this->adapter = $adapter; |
34 | 34 | } |
35 | 35 | |
36 | + /** |
|
37 | + * @param integer $status |
|
38 | + */ |
|
36 | 39 | public function getPaginationSelect($status = null) |
37 | 40 | { |
38 | 41 | $select = $this->getSql()->select() |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | public function getPaginationSelect($status = null) |
35 | 35 | { |
36 | 36 | $select = $this->getSql()->select() |
37 | - ->columns(['title', 'body', 'longitude', 'latitude']) |
|
37 | + ->columns([ 'title', 'body', 'longitude', 'latitude' ]) |
|
38 | 38 | ->join('articles', 'article_events.article_uuid = articles.article_uuid') |
39 | 39 | ->join( |
40 | 40 | 'admin_users', |
41 | 41 | 'admin_users.admin_user_uuid = articles.admin_user_uuid', |
42 | - ['admin_user_id', 'first_name', 'last_name'] |
|
43 | - )->where(['articles.type' => ArticleType::EVENT]) |
|
44 | - ->order(['created_at' => 'desc']); |
|
42 | + [ 'admin_user_id', 'first_name', 'last_name' ] |
|
43 | + )->where([ 'articles.type' => ArticleType::EVENT ]) |
|
44 | + ->order([ 'created_at' => 'desc' ]); |
|
45 | 45 | |
46 | 46 | if ($status) { |
47 | - $select->where(['articles.status' => (int)$status]); |
|
47 | + $select->where([ 'articles.status' => (int) $status ]); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return $select; |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | ->join('articles', 'article_events.article_uuid = articles.article_uuid') |
57 | 57 | ->join( |
58 | 58 | 'category', 'category.category_uuid = articles.category_uuid', |
59 | - ['category_slug' => 'slug', 'category_name' => 'name', 'category_id'], 'left' |
|
59 | + [ 'category_slug' => 'slug', 'category_name' => 'name', 'category_id' ], 'left' |
|
60 | 60 | ) |
61 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['admin_user_id'], 'left') |
|
62 | - ->where(['articles.article_id' => $id]); |
|
61 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'admin_user_id' ], 'left') |
|
62 | + ->where([ 'articles.article_id' => $id ]); |
|
63 | 63 | |
64 | 64 | return $this->selectWith($select)->current(); |
65 | 65 | } |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | ->join('articles', 'article_events.article_uuid = articles.article_uuid') |
71 | 71 | ->join( |
72 | 72 | 'category', 'category.category_uuid = articles.category_uuid', |
73 | - ['category_slug' => 'slug', 'category_name' => 'name', 'category_id'], 'left' |
|
73 | + [ 'category_slug' => 'slug', 'category_name' => 'name', 'category_id' ], 'left' |
|
74 | 74 | ) |
75 | - ->where(['articles.slug' => $slug]); |
|
75 | + ->where([ 'articles.slug' => $slug ]); |
|
76 | 76 | |
77 | 77 | return $this->selectWith($select)->current(); |
78 | 78 | } |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | ->join( |
84 | 84 | 'articles', |
85 | 85 | 'article_events.article_uuid = articles.article_uuid', |
86 | - ['article_id', 'slug', 'published_at'] |
|
87 | - )->where(['articles.status' => 1]) |
|
88 | - ->order(['published_at' => 'desc']) |
|
86 | + [ 'article_id', 'slug', 'published_at' ] |
|
87 | + )->where([ 'articles.status' => 1 ]) |
|
88 | + ->order([ 'published_at' => 'desc' ]) |
|
89 | 89 | ->limit($limit); |
90 | 90 | |
91 | 91 | return $this->selectWith($select); |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | public function getFuture() |
95 | 95 | { |
96 | 96 | $select = $this->getSql()->select() |
97 | - ->where(['articles.status' => 1]) |
|
97 | + ->where([ 'articles.status' => 1 ]) |
|
98 | 98 | ->join( |
99 | 99 | 'articles', |
100 | 100 | 'articles.article_uuid = article_events.article_uuid', |
101 | - ['article_id', 'slug', 'published_at'] |
|
101 | + [ 'article_id', 'slug', 'published_at' ] |
|
102 | 102 | )->order(new Expression('rand()')); |
103 | 103 | |
104 | 104 | $select->where->greaterThanOrEqualTo('end_at', date('Y-m-d H:i:s')); |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | public function getPastSelect() |
110 | 110 | { |
111 | 111 | $select = $this->getSql()->select() |
112 | - ->where(['articles.status' => 1]) |
|
112 | + ->where([ 'articles.status' => 1 ]) |
|
113 | 113 | ->join( |
114 | 114 | 'articles', |
115 | 115 | 'articles.article_uuid = article_events.article_uuid', |
116 | - ['article_id', 'slug', 'published_at'] |
|
117 | - )->order(['start_at' => 'desc']); |
|
116 | + [ 'article_id', 'slug', 'published_at' ] |
|
117 | + )->order([ 'start_at' => 'desc' ]); |
|
118 | 118 | $select->where->lessThan('end_at', date('Y-m-d H:i:s')); |
119 | 119 | |
120 | 120 | return $select; |
@@ -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') |