@@ -25,28 +25,28 @@ |
||
25 | 25 | /** |
26 | 26 | * |
27 | 27 | * |
28 | - * @var Bcrypt $crypt |
|
28 | + * @var Bcrypt $crypt |
|
29 | 29 | */ |
30 | 30 | private $crypt; |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * |
34 | 34 | * |
35 | - * @var AdminUsersMapper $adminUsersMapper |
|
35 | + * @var AdminUsersMapper $adminUsersMapper |
|
36 | 36 | */ |
37 | 37 | private $adminUsersMapper; |
38 | 38 | |
39 | 39 | /** |
40 | 40 | * |
41 | 41 | * |
42 | - * @var AdminUserFilter $adminUserFilter |
|
42 | + * @var AdminUserFilter $adminUserFilter |
|
43 | 43 | */ |
44 | 44 | private $adminUserFilter; |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * |
48 | 48 | * |
49 | - * @var Upload $upload |
|
49 | + * @var Upload $upload |
|
50 | 50 | */ |
51 | 51 | private $upload; |
52 | 52 |
@@ -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 Core\Service; |
6 | 6 | |
@@ -81,17 +81,17 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function loginUser($email, $password) |
83 | 83 | { |
84 | - if(!$email || !$password) { |
|
84 | + if (!$email || !$password) { |
|
85 | 85 | throw new \Exception('Both email and password are required.', 400); |
86 | 86 | } |
87 | 87 | |
88 | 88 | $user = $this->adminUsersMapper->getByEmail($email); |
89 | 89 | |
90 | - if(!$user) { |
|
90 | + if (!$user) { |
|
91 | 91 | throw new \Exception('User does not exist.'); |
92 | 92 | } |
93 | 93 | |
94 | - if(!$this->crypt->verify($password, $user->password)) { |
|
94 | + if (!$this->crypt->verify($password, $user->password)) { |
|
95 | 95 | throw new \Exception('Password does not match.'); |
96 | 96 | } |
97 | 97 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $filter = $this->adminUserFilter->getInputFilter()->setData($data); |
137 | 137 | |
138 | - if(!$filter->isValid()) { |
|
138 | + if (!$filter->isValid()) { |
|
139 | 139 | throw new FilterException($filter->getMessages()); |
140 | 140 | } |
141 | 141 | |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | 'profile_img' => $this->upload->uploadImage($data, 'profile_img') |
145 | 145 | ]; |
146 | 146 | |
147 | - unset($data['confirm_password']); |
|
148 | - $data['password'] = $this->crypt->create($data['password']); |
|
149 | - $data['admin_user_id'] = Uuid::uuid1()->toString(); |
|
150 | - $data['admin_user_uuid'] = (new MysqlUuid($data['admin_user_id']))->toFormat(new Binary); |
|
147 | + unset($data[ 'confirm_password' ]); |
|
148 | + $data[ 'password' ] = $this->crypt->create($data[ 'password' ]); |
|
149 | + $data[ 'admin_user_id' ] = Uuid::uuid1()->toString(); |
|
150 | + $data[ 'admin_user_uuid' ] = (new MysqlUuid($data[ 'admin_user_id' ]))->toFormat(new Binary); |
|
151 | 151 | |
152 | 152 | return $this->adminUsersMapper->insert($data); |
153 | 153 | } |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | $filter = $this->adminUserFilter->getInputFilter()->setData($data); |
162 | 162 | |
163 | 163 | // we dont want to force user to enter the password again |
164 | - if($data['password'] == '') { |
|
164 | + if ($data[ 'password' ] == '') { |
|
165 | 165 | $filter->remove('password'); |
166 | 166 | $filter->remove('confirm_password'); |
167 | 167 | } |
168 | 168 | |
169 | 169 | // if we want to keep same email |
170 | - if($user->email == $data['email']) { |
|
170 | + if ($user->email == $data[ 'email' ]) { |
|
171 | 171 | $filter->remove('email'); |
172 | 172 | } |
173 | 173 | |
174 | - if(!$filter->isValid()) { |
|
174 | + if (!$filter->isValid()) { |
|
175 | 175 | throw new FilterException($filter->getMessages()); |
176 | 176 | } |
177 | 177 | |
@@ -181,26 +181,26 @@ discard block |
||
181 | 181 | ]; |
182 | 182 | |
183 | 183 | // We don't want to force user to re-upload image on edit |
184 | - if(!$data['face_img']) { |
|
185 | - unset($data['face_img']); |
|
184 | + if (!$data[ 'face_img' ]) { |
|
185 | + unset($data[ 'face_img' ]); |
|
186 | 186 | } |
187 | - else{ |
|
187 | + else { |
|
188 | 188 | $this->upload->deleteFile($user->face_img); |
189 | 189 | } |
190 | 190 | |
191 | - if(!$data['profile_img']) { |
|
192 | - unset($data['profile_img']); |
|
191 | + if (!$data[ 'profile_img' ]) { |
|
192 | + unset($data[ 'profile_img' ]); |
|
193 | 193 | } |
194 | - else{ |
|
194 | + else { |
|
195 | 195 | $this->upload->deleteFile($user->profile_img); |
196 | 196 | } |
197 | 197 | |
198 | - if(isset($data['password'])) { |
|
199 | - unset($data['confirm_password']); |
|
200 | - $data['password'] = $this->crypt->create($data['password']); |
|
198 | + if (isset($data[ 'password' ])) { |
|
199 | + unset($data[ 'confirm_password' ]); |
|
200 | + $data[ 'password' ] = $this->crypt->create($data[ 'password' ]); |
|
201 | 201 | } |
202 | 202 | |
203 | - return $this->adminUsersMapper->update($data, ['admin_user_id' => $userId]); |
|
203 | + return $this->adminUsersMapper->update($data, [ 'admin_user_id' => $userId ]); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function delete($userId) |
214 | 214 | { |
215 | - if(!($adminUser = $this->getUser($userId))) { |
|
215 | + if (!($adminUser = $this->getUser($userId))) { |
|
216 | 216 | throw new \Exception('Admin user not found.'); |
217 | 217 | } |
218 | 218 | |
219 | 219 | $this->upload->deleteFile($adminUser->face_img); |
220 | 220 | $this->upload->deleteFile($adminUser->profile_img); |
221 | 221 | |
222 | - return (bool)$this->adminUsersMapper->delete(['admin_user_id' => $userId]); |
|
222 | + return (bool) $this->adminUsersMapper->delete([ 'admin_user_id' => $userId ]); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $allMsgs = ''; |
22 | 22 | array_walk_recursive( |
23 | - $msgs, function ($value) use (&$allMsgs) { |
|
23 | + $msgs, function($value) use (&$allMsgs) { |
|
24 | 24 | $allMsgs .= "- " . $value . "<br/>"; |
25 | 25 | } |
26 | 26 | ); |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | |
20 | 20 | public function getInputFilter() |
21 | 21 | { |
22 | - if(!$this->inputFilter) { |
|
22 | + if (!$this->inputFilter) { |
|
23 | 23 | $inputFilter = new InputFilter(); |
24 | 24 | |
25 | 25 | $inputFilter->add( |
26 | 26 | [ |
27 | 27 | 'name' => 'first_name', |
28 | 28 | 'required' => true, |
29 | - 'filters' => [['name' => 'StringTrim']], |
|
29 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
30 | 30 | 'validators' => [ |
31 | - ['name' => 'NotEmpty'], |
|
32 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 255]] |
|
31 | + [ 'name' => 'NotEmpty' ], |
|
32 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 255 ] ] |
|
33 | 33 | ], |
34 | 34 | ] |
35 | 35 | ); |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | [ |
39 | 39 | 'name' => 'last_name', |
40 | 40 | 'required' => true, |
41 | - 'filters' => [['name' => 'StringTrim']], |
|
41 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
42 | 42 | 'validators' => [ |
43 | - ['name' => 'NotEmpty'], |
|
44 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 255]] |
|
43 | + [ 'name' => 'NotEmpty' ], |
|
44 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 255 ] ] |
|
45 | 45 | ], |
46 | 46 | ] |
47 | 47 | ); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | [ |
51 | 51 | 'name' => 'email', |
52 | 52 | 'required' => true, |
53 | - 'filters' => [['name' => 'StringTrim']], |
|
53 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
54 | 54 | 'validators' => [ |
55 | - ['name' => 'NotEmpty'], |
|
56 | - ['name' => 'EmailAddress'], |
|
57 | - ['name' => 'dbnorecordexists', 'options' => ['adapter' => $this->adapter, 'table' => 'admin_users', 'field' => 'email']], |
|
55 | + [ 'name' => 'NotEmpty' ], |
|
56 | + [ 'name' => 'EmailAddress' ], |
|
57 | + [ 'name' => 'dbnorecordexists', 'options' => [ 'adapter' => $this->adapter, 'table' => 'admin_users', 'field' => 'email' ] ], |
|
58 | 58 | |
59 | 59 | ], |
60 | 60 | ] |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | [ |
65 | 65 | 'name' => 'introduction', |
66 | 66 | 'required' => false, |
67 | - 'filters' => [['name' => 'StringTrim']] |
|
67 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
68 | 68 | ] |
69 | 69 | ); |
70 | 70 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | [ |
73 | 73 | 'name' => 'biography', |
74 | 74 | 'required' => false, |
75 | - 'filters' => [['name' => 'StringTrim']] |
|
75 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
76 | 76 | ] |
77 | 77 | ); |
78 | 78 | |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | 'name' => 'password', |
82 | 82 | 'required' => true, |
83 | 83 | 'validators' => [ |
84 | - ['name' => 'NotEmpty'], |
|
85 | - ['name' => 'StringLength', 'options' => ['min' => 7, 'max' => 255]] |
|
84 | + [ 'name' => 'NotEmpty' ], |
|
85 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 7, 'max' => 255 ] ] |
|
86 | 86 | ], |
87 | 87 | ] |
88 | 88 | ); |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | 'name' => 'confirm_password', |
93 | 93 | 'required' => true, |
94 | 94 | 'validators' => [ |
95 | - ['name' => 'NotEmpty'], |
|
96 | - ['name' => 'Identical', 'options' => ['token' => 'password']], |
|
95 | + [ 'name' => 'NotEmpty' ], |
|
96 | + [ 'name' => 'Identical', 'options' => [ 'token' => 'password' ] ], |
|
97 | 97 | ], |
98 | 98 | ] |
99 | 99 | ); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | [ |
103 | 103 | 'name' => 'status', |
104 | 104 | 'required' => true, |
105 | - 'validators' => [['name' => 'NotEmpty'], ['name' => 'Digits']] |
|
105 | + 'validators' => [ [ 'name' => 'NotEmpty' ], [ 'name' => 'Digits' ] ] |
|
106 | 106 | ] |
107 | 107 | ); |
108 | 108 |
@@ -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 | } |
@@ -15,21 +15,21 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * |
17 | 17 | * |
18 | - * @var Template |
|
18 | + * @var Template |
|
19 | 19 | */ |
20 | 20 | private $template; |
21 | 21 | |
22 | 22 | /** |
23 | 23 | * |
24 | 24 | * |
25 | - * @var Router |
|
25 | + * @var Router |
|
26 | 26 | */ |
27 | 27 | private $router; |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * |
31 | 31 | * |
32 | - * @var PageService |
|
32 | + * @var PageService |
|
33 | 33 | */ |
34 | 34 | private $pageService; |
35 | 35 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * |
52 | 52 | * |
53 | - * @return HtmlResponse |
|
53 | + * @return HtmlResponse |
|
54 | 54 | */ |
55 | 55 | public function index(): HtmlResponse |
56 | 56 | { |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | public function index(): HtmlResponse |
56 | 56 | { |
57 | 57 | $params = $this->request->getQueryParams(); |
58 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
59 | - $limit = isset($params['limit']) ? $params['limit'] : 15; |
|
58 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
59 | + $limit = isset($params[ 'limit' ]) ? $params[ 'limit' ] : 15; |
|
60 | 60 | $pagination = $this->pageService->getPagination($page, $limit); |
61 | 61 | |
62 | 62 | return new HtmlResponse( |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | - public function edit($errors = []): HtmlResponse |
|
72 | + public function edit($errors = [ ]): HtmlResponse |
|
73 | 73 | { |
74 | 74 | $id = $this->request->getAttribute('id'); |
75 | 75 | $page = $this->pageService->getPage($id); |
76 | 76 | |
77 | - if($this->request->getParsedBody()) { |
|
77 | + if ($this->request->getParsedBody()) { |
|
78 | 78 | $page = new \Page\Entity\Page(); |
79 | - $page->exchangeArray($this->request->getParsedBody() + (array)$page); |
|
79 | + $page->exchangeArray($this->request->getParsedBody() + (array) $page); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return new HtmlResponse( |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | try { |
96 | 96 | $pageId = $this->request->getAttribute('id'); |
97 | 97 | $data = $this->request->getParsedBody(); |
98 | - $data += (new Request())->getFiles()->toArray(); |
|
98 | + $data += (new Request())->getFiles()->toArray(); |
|
99 | 99 | |
100 | - if($pageId) { |
|
100 | + if ($pageId) { |
|
101 | 101 | $this->pageService->updatePage($data, $pageId); |
102 | 102 | } |
103 | 103 | else { |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | |
107 | 107 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages')); |
108 | 108 | } |
109 | - catch(FilterException $fe) { |
|
109 | + catch (FilterException $fe) { |
|
110 | 110 | return $this->edit($fe->getArrayMessages()); |
111 | 111 | } |
112 | - catch(\Exception $e) { |
|
112 | + catch (\Exception $e) { |
|
113 | 113 | throw $e; |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages')); |
124 | 124 | } |
125 | - catch(\Exception $e) { |
|
125 | + catch (\Exception $e) { |
|
126 | 126 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages')); |
127 | 127 | } |
128 | 128 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->pageMapper->getAdapter(), |
37 | 37 | $this->pageMapper->getResultSetPrototype() |
38 | 38 | ); |
39 | - $pagination = new Paginator($paginationAdapter); |
|
39 | + $pagination = new Paginator($paginationAdapter); |
|
40 | 40 | |
41 | 41 | $pagination->setCurrentPageNumber($page); |
42 | 42 | $pagination->setItemCountPerPage($limit); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getPage($pageId) |
53 | 53 | { |
54 | - return $this->pageMapper->select(['page_id' => $pageId])->current(); |
|
54 | + return $this->pageMapper->select([ 'page_id' => $pageId ])->current(); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function getHomepage() |
71 | 71 | { |
72 | - return $this->pageMapper->select(['is_homepage' => true])->current(); |
|
72 | + return $this->pageMapper->select([ 'is_homepage' => true ])->current(); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | $data = $filter->getValues() |
90 | - + ['main_img' => $this->upload->uploadImage($data, 'main_img')]; |
|
91 | - $data['page_id'] = Uuid::uuid1()->toString(); |
|
92 | - $data['page_uuid'] |
|
93 | - = (new MysqlUuid($data['page_id']))->toFormat(new Binary); |
|
90 | + + [ 'main_img' => $this->upload->uploadImage($data, 'main_img') ]; |
|
91 | + $data[ 'page_id' ] = Uuid::uuid1()->toString(); |
|
92 | + $data[ 'page_uuid' ] |
|
93 | + = (new MysqlUuid($data[ 'page_id' ]))->toFormat(new Binary); |
|
94 | 94 | |
95 | - if ($data['is_homepage']) { |
|
96 | - $this->pageMapper->update(['is_homepage' => false]); |
|
95 | + if ($data[ 'is_homepage' ]) { |
|
96 | + $this->pageMapper->update([ 'is_homepage' => false ]); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $this->pageMapper->insert($data); |
@@ -112,21 +112,21 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | $data = $filter->getValues() |
115 | - + ['main_img' => $this->upload->uploadImage($data, 'main_img')]; |
|
115 | + + [ 'main_img' => $this->upload->uploadImage($data, 'main_img') ]; |
|
116 | 116 | |
117 | 117 | // We don't want to force user to re-upload image on edit |
118 | - if (!$data['main_img']) { |
|
119 | - unset($data['main_img']); |
|
118 | + if (!$data[ 'main_img' ]) { |
|
119 | + unset($data[ 'main_img' ]); |
|
120 | 120 | } |
121 | 121 | else { |
122 | 122 | $this->upload->deleteFile($page->getMainImg()); |
123 | 123 | } |
124 | 124 | |
125 | - if ($data['is_homepage']) { |
|
126 | - $this->pageMapper->update(['is_homepage' => false]); |
|
125 | + if ($data[ 'is_homepage' ]) { |
|
126 | + $this->pageMapper->update([ 'is_homepage' => false ]); |
|
127 | 127 | } |
128 | 128 | |
129 | - return $this->pageMapper->update($data, ['page_id' => $pageId]); |
|
129 | + return $this->pageMapper->update($data, [ 'page_id' => $pageId ]); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | public function delete($pageId) |
@@ -137,6 +137,6 @@ discard block |
||
137 | 137 | |
138 | 138 | $this->upload->deleteFile($page->getMainImg()); |
139 | 139 | |
140 | - return (bool)$this->pageMapper->delete(['page_id' => $pageId]); |
|
140 | + return (bool) $this->pageMapper->delete([ 'page_id' => $pageId ]); |
|
141 | 141 | } |
142 | 142 | } |
@@ -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 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * |
38 | 38 | * |
39 | - * @return mixed |
|
39 | + * @return mixed |
|
40 | 40 | */ |
41 | 41 | public function getSlug() |
42 | 42 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * |
48 | 48 | * |
49 | - * @param mixed $slug |
|
49 | + * @param mixed $slug |
|
50 | 50 | */ |
51 | 51 | public function setSlug($slug) |
52 | 52 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * |
62 | 62 | * |
63 | - * @return mixed |
|
63 | + * @return mixed |
|
64 | 64 | */ |
65 | 65 | public function getIsActive() |
66 | 66 | { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * |
72 | 72 | * |
73 | - * @param mixed $is_active |
|
73 | + * @param mixed $is_active |
|
74 | 74 | */ |
75 | 75 | public function setIsActive($is_active) |
76 | 76 | { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | /** |
81 | 81 | * |
82 | 82 | * |
83 | - * @return binary |
|
83 | + * @return binary |
|
84 | 84 | */ |
85 | 85 | public function getPageUuid() |
86 | 86 | { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * |
92 | 92 | * |
93 | - * @param binary $page_uuid |
|
93 | + * @param binary $page_uuid |
|
94 | 94 | */ |
95 | 95 | public function setPageUuid($page_uuid) |
96 | 96 | { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * |
102 | 102 | * |
103 | - * @return mixed |
|
103 | + * @return mixed |
|
104 | 104 | */ |
105 | 105 | public function getPageId() |
106 | 106 | { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | /** |
111 | 111 | * |
112 | 112 | * |
113 | - * @param mixed $page_id |
|
113 | + * @param mixed $page_id |
|
114 | 114 | */ |
115 | 115 | public function setPageId($page_id) |
116 | 116 | { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * |
122 | 122 | * |
123 | - * @return mixed |
|
123 | + * @return mixed |
|
124 | 124 | */ |
125 | 125 | public function getTitle() |
126 | 126 | { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | /** |
131 | 131 | * |
132 | 132 | * |
133 | - * @param mixed $title |
|
133 | + * @param mixed $title |
|
134 | 134 | */ |
135 | 135 | public function setTitle($title) |
136 | 136 | { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | /** |
141 | 141 | * |
142 | 142 | * |
143 | - * @return mixed |
|
143 | + * @return mixed |
|
144 | 144 | */ |
145 | 145 | public function getBody() |
146 | 146 | { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * |
152 | 152 | * |
153 | - * @param mixed $body |
|
153 | + * @param mixed $body |
|
154 | 154 | */ |
155 | 155 | public function setBody($body) |
156 | 156 | { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | /** |
174 | 174 | * |
175 | 175 | * |
176 | - * @param mixed $description |
|
176 | + * @param mixed $description |
|
177 | 177 | */ |
178 | 178 | public function setDescription($description) |
179 | 179 | { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | /** |
184 | 184 | * |
185 | 185 | * |
186 | - * @return mixed |
|
186 | + * @return mixed |
|
187 | 187 | */ |
188 | 188 | public function getMainImg() |
189 | 189 | { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | /** |
194 | 194 | * |
195 | 195 | * |
196 | - * @param mixed $main_img |
|
196 | + * @param mixed $main_img |
|
197 | 197 | */ |
198 | 198 | public function setMainImg($main_img) |
199 | 199 | { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * |
205 | 205 | * |
206 | - * @return mixed |
|
206 | + * @return mixed |
|
207 | 207 | */ |
208 | 208 | public function getHasLayout() |
209 | 209 | { |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | /** |
220 | 220 | * |
221 | 221 | * |
222 | - * @return mixed |
|
222 | + * @return mixed |
|
223 | 223 | */ |
224 | 224 | public function getIsHomepage() |
225 | 225 | { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | /** |
230 | 230 | * |
231 | 231 | * |
232 | - * @param mixed $is_homepage |
|
232 | + * @param mixed $is_homepage |
|
233 | 233 | */ |
234 | 234 | public function setIsHomepage($is_homepage) |
235 | 235 | { |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * |
254 | 254 | * |
255 | - * @param string $created_at |
|
255 | + * @param string $created_at |
|
256 | 256 | */ |
257 | 257 | public function setCreatedAt(string $created_at) |
258 | 258 | { |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | /** |
275 | 275 | * |
276 | 276 | * |
277 | - * @return Array |
|
277 | + * @return Array |
|
278 | 278 | */ |
279 | 279 | public function getArrayCopy() |
280 | 280 | { |
@@ -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> |