@@ -101,15 +101,15 @@ discard block |
||
101 | 101 | |
102 | 102 | $article = $articleFilter->getValues(); |
103 | 103 | $article += [ |
104 | - 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article['admin_user_id']), |
|
104 | + 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]), |
|
105 | 105 | 'type' => ArticleType::EVENT, |
106 | 106 | 'article_id' => $id, |
107 | 107 | 'article_uuid' => $uuId |
108 | 108 | ]; |
109 | - unset($article['admin_user_id']); |
|
109 | + unset($article[ 'admin_user_id' ]); |
|
110 | 110 | |
111 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
112 | - unset($article['category_id']); |
|
111 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
112 | + unset($article[ 'category_id' ]); |
|
113 | 113 | |
114 | 114 | $event = $eventFilter->getValues() + [ |
115 | 115 | 'featured_img' => $this->upload->uploadImage($data, 'featured_img'), |
@@ -131,31 +131,31 @@ discard block |
||
131 | 131 | throw new FilterException($articleFilter->getMessages() + $eventFilter->getMessages()); |
132 | 132 | } |
133 | 133 | |
134 | - $article = $articleFilter->getValues() + ['article_uuid' => $oldArticle->article_uuid]; |
|
134 | + $article = $articleFilter->getValues() + [ 'article_uuid' => $oldArticle->article_uuid ]; |
|
135 | 135 | $event = $eventFilter->getValues() + [ |
136 | 136 | 'featured_img' => $this->upload->uploadImage($data, 'featured_img'), |
137 | 137 | 'main_img' => $this->upload->uploadImage($data, 'main_img') |
138 | 138 | ]; |
139 | 139 | |
140 | - $article['admin_user_uuid'] = $this->adminUsersMapper->getUuid($article['admin_user_id']); |
|
141 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
142 | - unset($article['category_id'], $article['admin_user_id']); |
|
140 | + $article[ 'admin_user_uuid' ] = $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]); |
|
141 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
142 | + unset($article[ 'category_id' ], $article[ 'admin_user_id' ]); |
|
143 | 143 | |
144 | 144 | // We don't want to force user to re-upload image on edit |
145 | - if (!$event['featured_img']) { |
|
146 | - unset($event['featured_img']); |
|
145 | + if (!$event[ 'featured_img' ]) { |
|
146 | + unset($event[ 'featured_img' ]); |
|
147 | 147 | } else { |
148 | 148 | $this->upload->deleteFile($oldArticle->featured_img); |
149 | 149 | } |
150 | 150 | |
151 | - if (!$event['main_img']) { |
|
152 | - unset($event['main_img']); |
|
151 | + if (!$event[ 'main_img' ]) { |
|
152 | + unset($event[ 'main_img' ]); |
|
153 | 153 | } else { |
154 | 154 | $this->upload->deleteFile($oldArticle->main_img); |
155 | 155 | } |
156 | 156 | |
157 | - $this->articleMapper->update($article, ['article_uuid' => $article['article_uuid']]); |
|
158 | - $this->articleEventsMapper->update($event, ['article_uuid' => $article['article_uuid']]); |
|
157 | + $this->articleMapper->update($article, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
158 | + $this->articleEventsMapper->update($event, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | public function deleteArticle($id) |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | $this->upload->deleteFile($event->main_img); |
170 | 170 | $this->upload->deleteFile($event->featured_img); |
171 | - $this->articleEventsMapper->delete(['article_uuid' => $event->article_uuid]); |
|
171 | + $this->articleEventsMapper->delete([ 'article_uuid' => $event->article_uuid ]); |
|
172 | 172 | $this->delete($event->article_uuid); |
173 | 173 | } |
174 | 174 | } |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | |
128 | 128 | $article = $articleFilter->getValues(); |
129 | 129 | $article += [ |
130 | - 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article['admin_user_id']), |
|
130 | + 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]), |
|
131 | 131 | 'type' => ArticleType::VIDEO, |
132 | 132 | 'article_id' => $id, |
133 | 133 | 'article_uuid' => $uuId |
134 | 134 | ]; |
135 | 135 | |
136 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
137 | - unset($article['category_id'], $article['admin_user_id']); |
|
136 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
137 | + unset($article[ 'category_id' ], $article[ 'admin_user_id' ]); |
|
138 | 138 | |
139 | 139 | $videos = $videosFilter->getValues() + [ |
140 | 140 | 'featured_img' => $this->upload->uploadImage($data, 'featured_img'), |
@@ -156,11 +156,11 @@ discard block |
||
156 | 156 | throw new FilterException($articleFilter->getMessages() + $videosFilter->getMessages()); |
157 | 157 | } |
158 | 158 | |
159 | - $article = $articleFilter->getValues() + ['article_uuid' => $oldArticle->article_uuid]; |
|
160 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
161 | - $article['admin_user_uuid'] = $this->adminUsersMapper->getUuid($article['admin_user_id']); |
|
162 | - unset($article['category_id']); |
|
163 | - unset($article['admin_user_id']); |
|
159 | + $article = $articleFilter->getValues() + [ 'article_uuid' => $oldArticle->article_uuid ]; |
|
160 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
161 | + $article[ 'admin_user_uuid' ] = $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]); |
|
162 | + unset($article[ 'category_id' ]); |
|
163 | + unset($article[ 'admin_user_id' ]); |
|
164 | 164 | |
165 | 165 | $videos = $videosFilter->getValues() + [ |
166 | 166 | 'featured_img' => $this->upload->uploadImage($data, 'featured_img'), |
@@ -168,20 +168,20 @@ discard block |
||
168 | 168 | ]; |
169 | 169 | |
170 | 170 | // We don't want to force user to re-upload image on edit |
171 | - if (!$videos['featured_img']) { |
|
172 | - unset($videos['featured_img']); |
|
171 | + if (!$videos[ 'featured_img' ]) { |
|
172 | + unset($videos[ 'featured_img' ]); |
|
173 | 173 | } else { |
174 | 174 | $this->upload->deleteFile($oldArticle->featured_img); |
175 | 175 | } |
176 | 176 | |
177 | - if (!$videos['main_img']) { |
|
178 | - unset($videos['main_img']); |
|
177 | + if (!$videos[ 'main_img' ]) { |
|
178 | + unset($videos[ 'main_img' ]); |
|
179 | 179 | } else { |
180 | 180 | $this->upload->deleteFile($oldArticle->main_img); |
181 | 181 | } |
182 | 182 | |
183 | - $this->articleMapper->update($article, ['article_uuid' => $article['article_uuid']]); |
|
184 | - $this->articleVideosMapper->update($videos, ['article_uuid' => $article['article_uuid']]); |
|
183 | + $this->articleMapper->update($article, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
184 | + $this->articleVideosMapper->update($videos, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | public function deleteArticle($id) |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | $this->upload->deleteFile($video->main_img); |
196 | 196 | $this->upload->deleteFile($video->featured_img); |
197 | - $this->articleVideosMapper->delete(['article_uuid' => $video->article_uuid]); |
|
197 | + $this->articleVideosMapper->delete([ 'article_uuid' => $video->article_uuid ]); |
|
198 | 198 | $this->delete($video->article_uuid); |
199 | 199 | } |
200 | 200 | } |
@@ -137,19 +137,19 @@ discard block |
||
137 | 137 | |
138 | 138 | $article = $articleFilter->getValues(); |
139 | 139 | $article += [ |
140 | - 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article['admin_user_id']), |
|
140 | + 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]), |
|
141 | 141 | 'type' => ArticleType::POST, |
142 | 142 | 'article_id' => $id, |
143 | 143 | 'article_uuid' => $uuId |
144 | 144 | ]; |
145 | 145 | |
146 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
147 | - unset($article['category_id'], $article['admin_user_id']); |
|
146 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
147 | + unset($article[ 'category_id' ], $article[ 'admin_user_id' ]); |
|
148 | 148 | |
149 | 149 | $post = $postFilter->getValues() + [ |
150 | 150 | 'featured_img' => $this->upload->uploadImage($data, 'featured_img'), |
151 | 151 | 'main_img' => $this->upload->uploadImage($data, 'main_img'), |
152 | - 'article_uuid' => $article['article_uuid'] |
|
152 | + 'article_uuid' => $article[ 'article_uuid' ] |
|
153 | 153 | ]; |
154 | 154 | |
155 | 155 | $this->articleMapper->insert($article); |
@@ -166,31 +166,31 @@ discard block |
||
166 | 166 | throw new FilterException($articleFilter->getMessages() + $postFilter->getMessages()); |
167 | 167 | } |
168 | 168 | |
169 | - $article = $articleFilter->getValues() + ['article_uuid' => $oldArticle->article_uuid]; |
|
169 | + $article = $articleFilter->getValues() + [ 'article_uuid' => $oldArticle->article_uuid ]; |
|
170 | 170 | $post = $postFilter->getValues() + [ |
171 | 171 | 'featured_img' => $this->upload->uploadImage($data, 'featured_img'), |
172 | 172 | 'main_img' => $this->upload->uploadImage($data, 'main_img') |
173 | 173 | ]; |
174 | 174 | |
175 | - $article['admin_user_uuid'] = $this->adminUsersMapper->getUuid($article['admin_user_id']); |
|
176 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
177 | - unset($article['category_id'], $article['admin_user_id']); |
|
175 | + $article[ 'admin_user_uuid' ] = $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]); |
|
176 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
177 | + unset($article[ 'category_id' ], $article[ 'admin_user_id' ]); |
|
178 | 178 | |
179 | 179 | // We don't want to force user to re-upload image on edit |
180 | - if (!$post['featured_img']) { |
|
181 | - unset($post['featured_img']); |
|
180 | + if (!$post[ 'featured_img' ]) { |
|
181 | + unset($post[ 'featured_img' ]); |
|
182 | 182 | } else { |
183 | 183 | $this->upload->deleteFile($oldArticle->featured_img); |
184 | 184 | } |
185 | 185 | |
186 | - if (!$post['main_img']) { |
|
187 | - unset($post['main_img']); |
|
186 | + if (!$post[ 'main_img' ]) { |
|
187 | + unset($post[ 'main_img' ]); |
|
188 | 188 | } else { |
189 | 189 | $this->upload->deleteFile($oldArticle->main_img); |
190 | 190 | } |
191 | 191 | |
192 | - $this->articleMapper->update($article, ['article_uuid' => $article['article_uuid']]); |
|
193 | - $this->articlePostsMapper->update($post, ['article_uuid' => $article['article_uuid']]); |
|
192 | + $this->articleMapper->update($article, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
193 | + $this->articlePostsMapper->update($post, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | public function deleteArticle($id) |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | $this->upload->deleteFile($post->main_img); |
205 | 205 | $this->upload->deleteFile($post->featured_img); |
206 | - $this->articlePostsMapper->delete(['article_uuid' => $post->article_uuid]); |
|
206 | + $this->articlePostsMapper->delete([ 'article_uuid' => $post->article_uuid ]); |
|
207 | 207 | $this->delete($post->article_uuid); |
208 | 208 | } |
209 | 209 |
@@ -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' => 100000]], |
|
36 | + [ 'name' => 'NotEmpty' ], |
|
37 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 100000 ] ], |
|
38 | 38 | ], |
39 | 39 | ] |
40 | 40 | ); |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | [ |
44 | 44 | 'name' => 'lead', |
45 | 45 | 'required' => true, |
46 | - 'filters' => [['name' => 'StringTrim']], |
|
46 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
47 | 47 | 'validators' => [ |
48 | - ['name' => 'NotEmpty'], |
|
49 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 50000]], |
|
48 | + [ 'name' => 'NotEmpty' ], |
|
49 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 50000 ] ], |
|
50 | 50 | ], |
51 | 51 | ] |
52 | 52 | ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | [ |
56 | 56 | 'name' => 'has_layout', |
57 | 57 | 'required' => false, |
58 | - 'filters' => [['name' => 'Boolean']], |
|
58 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
59 | 59 | ] |
60 | 60 | ); |
61 | 61 |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | [ |
20 | 20 | 'name' => 'slug', |
21 | 21 | 'required' => true, |
22 | - 'filters' => [['name' => 'StringTrim', 'options' => ['charlist' => '/']]], |
|
22 | + 'filters' => [ [ 'name' => 'StringTrim', 'options' => [ 'charlist' => '/' ] ] ], |
|
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' => 'published_at', |
33 | 33 | 'required' => true, |
34 | - 'filters' => [['name' => 'StringTrim']], |
|
34 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
35 | 35 | 'validators' => [ |
36 | - ['name' => 'NotEmpty'], |
|
37 | - ['name' => 'Date', 'options' => ['format' => 'Y-m-d H:i:s']] |
|
36 | + [ 'name' => 'NotEmpty' ], |
|
37 | + [ 'name' => 'Date', 'options' => [ 'format' => 'Y-m-d H:i:s' ] ] |
|
38 | 38 | ] |
39 | 39 | ] |
40 | 40 | ); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | [ |
58 | 58 | 'name' => 'status', |
59 | 59 | 'required' => false, |
60 | - 'filters' => [['name' => 'Boolean']], |
|
60 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
61 | 61 | ] |
62 | 62 | ); |
63 | 63 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | [ |
66 | 66 | 'name' => 'is_wysiwyg_editor', |
67 | 67 | 'required' => false, |
68 | - 'filters' => [['name' => 'Boolean']], |
|
68 | + 'filters' => [ [ 'name' => 'Boolean' ] ], |
|
69 | 69 | ] |
70 | 70 | ); |
71 | 71 |
@@ -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,7 +31,7 @@ discard block |
||
31 | 31 | [ |
32 | 32 | 'name' => 'sub_title', |
33 | 33 | 'required' => false, |
34 | - 'filters' => [['name' => 'StringTrim']] |
|
34 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
35 | 35 | ] |
36 | 36 | ); |
37 | 37 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | [ |
40 | 40 | 'name' => 'place_name', |
41 | 41 | 'required' => true, |
42 | - 'filters' => [['name' => 'StringTrim']] |
|
42 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
43 | 43 | ] |
44 | 44 | ); |
45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | [ |
48 | 48 | 'name' => 'event_url', |
49 | 49 | 'required' => false, |
50 | - 'filters' => [['name' => 'StringTrim']] |
|
50 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
51 | 51 | ] |
52 | 52 | ); |
53 | 53 | |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | [ |
56 | 56 | 'name' => 'body', |
57 | 57 | 'required' => true, |
58 | - 'filters' => [['name' => 'StringTrim']], |
|
58 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
59 | 59 | 'validators' => [ |
60 | - ['name' => 'NotEmpty'], |
|
61 | - ['name' => 'StringLength', 'options' => ['min' => 2]], |
|
60 | + [ 'name' => 'NotEmpty' ], |
|
61 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2 ] ], |
|
62 | 62 | ], |
63 | 63 | ] |
64 | 64 | ); |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | [ |
68 | 68 | 'name' => 'start_at', |
69 | 69 | 'required' => true, |
70 | - 'filters' => [['name' => 'StringTrim']], |
|
70 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
71 | 71 | 'validators' => [ |
72 | - ['name' => 'NotEmpty'], |
|
73 | - ['name' => 'Date', 'options' => ['format' => 'Y-m-d H:i:s']] |
|
72 | + [ 'name' => 'NotEmpty' ], |
|
73 | + [ 'name' => 'Date', 'options' => [ 'format' => 'Y-m-d H:i:s' ] ] |
|
74 | 74 | ] |
75 | 75 | ] |
76 | 76 | ); |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | [ |
80 | 80 | 'name' => 'end_at', |
81 | 81 | 'required' => true, |
82 | - 'filters' => [['name' => 'StringTrim']], |
|
82 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
83 | 83 | 'validators' => [ |
84 | - ['name' => 'NotEmpty'], |
|
85 | - ['name' => 'Date', 'options' => ['format' => 'Y-m-d H:i:s']] |
|
84 | + [ 'name' => 'NotEmpty' ], |
|
85 | + [ 'name' => 'Date', 'options' => [ 'format' => 'Y-m-d H:i:s' ] ] |
|
86 | 86 | ] |
87 | 87 | ] |
88 | 88 | ); |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | [ |
92 | 92 | 'name' => 'longitude', |
93 | 93 | 'required' => true, |
94 | - 'filters' => [['name' => 'StringTrim']], |
|
95 | - 'validators' => [['name' => 'NotEmpty']], |
|
94 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
95 | + 'validators' => [ [ 'name' => 'NotEmpty' ] ], |
|
96 | 96 | ] |
97 | 97 | ); |
98 | 98 | |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | [ |
101 | 101 | 'name' => 'latitude', |
102 | 102 | 'required' => true, |
103 | - 'filters' => [['name' => 'StringTrim']], |
|
104 | - 'validators' => [['name' => 'NotEmpty']], |
|
103 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
104 | + 'validators' => [ [ 'name' => 'NotEmpty' ] ], |
|
105 | 105 | ] |
106 | 106 | ); |
107 | 107 |
@@ -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' => 'sub_title', |
33 | 33 | 'required' => false, |
34 | - 'filters' => [['name' => 'StringTrim']], |
|
34 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
35 | 35 | 'validators' => [ |
36 | - ['name' => 'NotEmpty'], |
|
37 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 500]], |
|
36 | + [ 'name' => 'NotEmpty' ], |
|
37 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 500 ] ], |
|
38 | 38 | ], |
39 | 39 | ] |
40 | 40 | ); |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | [ |
44 | 44 | 'name' => 'body', |
45 | 45 | 'required' => true, |
46 | - 'filters' => [['name' => 'StringTrim']], |
|
46 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
47 | 47 | 'validators' => [ |
48 | - ['name' => 'NotEmpty'], |
|
49 | - ['name' => 'StringLength', 'options' => ['min' => 2]], |
|
48 | + [ 'name' => 'NotEmpty' ], |
|
49 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2 ] ], |
|
50 | 50 | ], |
51 | 51 | ] |
52 | 52 | ); |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | [ |
56 | 56 | 'name' => 'lead', |
57 | 57 | 'required' => true, |
58 | - 'filters' => [['name' => 'StringTrim']], |
|
58 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
59 | 59 | 'validators' => [ |
60 | - ['name' => 'NotEmpty'], |
|
61 | - ['name' => 'StringLength', 'options' => ['min' => 2]], |
|
60 | + [ 'name' => 'NotEmpty' ], |
|
61 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2 ] ], |
|
62 | 62 | ], |
63 | 63 | ] |
64 | 64 | ); |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | [ |
68 | 68 | 'name' => 'video_url', |
69 | 69 | 'required' => true, |
70 | - 'filters' => [['name' => 'StringTrim']], |
|
70 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
71 | 71 | 'validators' => [ |
72 | - ['name' => 'NotEmpty'], |
|
73 | - ['name' => 'StringLength'], |
|
72 | + [ 'name' => 'NotEmpty' ], |
|
73 | + [ 'name' => 'StringLength' ], |
|
74 | 74 | ], |
75 | 75 | ] |
76 | 76 | ); |
@@ -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), |