@@ -22,23 +22,23 @@ |
||
22 | 22 | public function getPaginationSelect() |
23 | 23 | { |
24 | 24 | return $this->getSql()->select() |
25 | - ->columns(['title', 'body']) |
|
25 | + ->columns([ 'title', 'body' ]) |
|
26 | 26 | ->join('articles', 'article_discussions.article_uuid = articles.article_uuid') |
27 | - ->where(['articles.type' => ArticleType::DISCUSSION]) |
|
28 | - ->order(['created_at' => 'desc']); |
|
27 | + ->where([ 'articles.type' => ArticleType::DISCUSSION ]) |
|
28 | + ->order([ 'created_at' => 'desc' ]); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public function get($id) |
32 | 32 | { |
33 | 33 | $select = $this->getSql()->select() |
34 | - ->columns(['title', 'body']) |
|
34 | + ->columns([ 'title', 'body' ]) |
|
35 | 35 | ->join('articles', 'article_discussions.article_uuid = articles.article_uuid') |
36 | 36 | ->join( |
37 | 37 | 'category', 'category.category_uuid = articles.category_uuid', |
38 | - ['category_slug' => 'slug', 'category_name' => 'name', 'category_id'], 'left' |
|
38 | + [ 'category_slug' => 'slug', 'category_name' => 'name', 'category_id' ], 'left' |
|
39 | 39 | ) |
40 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['admin_user_id'], 'left') |
|
41 | - ->where(['articles.article_id' => $id]); |
|
40 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'admin_user_id' ], 'left') |
|
41 | + ->where([ 'articles.article_id' => $id ]); |
|
42 | 42 | |
43 | 43 | return $this->selectWith($select)->current(); |
44 | 44 | } |
@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | |
69 | 69 | $article = $articleFilter->getValues(); |
70 | 70 | $article += [ |
71 | - 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article['admin_user_id']), |
|
71 | + 'admin_user_uuid' => $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]), |
|
72 | 72 | 'type' => ArticleType::DISCUSSION, |
73 | 73 | 'article_id' => $id, |
74 | 74 | 'article_uuid' => $uuId |
75 | 75 | ]; |
76 | 76 | |
77 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
78 | - unset($article['category_id'], $article['admin_user_id']); |
|
77 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
78 | + unset($article[ 'category_id' ], $article[ 'admin_user_id' ]); |
|
79 | 79 | |
80 | - $discussion = $discussionFilter->getValues() + ['article_uuid' => $uuId]; |
|
80 | + $discussion = $discussionFilter->getValues() + [ 'article_uuid' => $uuId ]; |
|
81 | 81 | |
82 | 82 | $this->articleMapper->insert($article); |
83 | 83 | $this->articleDiscussionsMapper->insert($discussion); |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | throw new FilterException($articleFilter->getMessages() + $discussionFilter->getMessages()); |
94 | 94 | } |
95 | 95 | |
96 | - $article = $articleFilter->getValues() + ['article_uuid' => $article->article_uuid]; |
|
96 | + $article = $articleFilter->getValues() + [ 'article_uuid' => $article->article_uuid ]; |
|
97 | 97 | $discussion = $discussionFilter->getValues(); |
98 | 98 | |
99 | - $article['admin_user_uuid'] = $this->adminUsersMapper->getUuid($article['admin_user_id']); |
|
100 | - $article['category_uuid'] = $this->categoryMapper->get($article['category_id'])->category_uuid; |
|
101 | - unset($article['category_id'], $article['admin_user_id']); |
|
99 | + $article[ 'admin_user_uuid' ] = $this->adminUsersMapper->getUuid($article[ 'admin_user_id' ]); |
|
100 | + $article[ 'category_uuid' ] = $this->categoryMapper->get($article[ 'category_id' ])->category_uuid; |
|
101 | + unset($article[ 'category_id' ], $article[ 'admin_user_id' ]); |
|
102 | 102 | |
103 | - $this->articleMapper->update($article, ['article_uuid' => $article['article_uuid']]); |
|
104 | - $this->articleDiscussionsMapper->update($discussion, ['article_uuid' => $article['article_uuid']]); |
|
103 | + $this->articleMapper->update($article, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
104 | + $this->articleDiscussionsMapper->update($discussion, [ 'article_uuid' => $article[ 'article_uuid' ] ]); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | public function deleteArticle($id) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | throw new \Exception('Article not found!'); |
113 | 113 | } |
114 | 114 | |
115 | - $this->articleDiscussionsMapper->delete(['article_uuid' => $discussion->article_uuid]); |
|
115 | + $this->articleDiscussionsMapper->delete([ 'article_uuid' => $discussion->article_uuid ]); |
|
116 | 116 | $this->delete($discussion->article_uuid); |
117 | 117 | } |
118 | 118 | } |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | |
32 | 32 | public function getCategoryIds($articleId) |
33 | 33 | { |
34 | - $categories = []; |
|
34 | + $categories = [ ]; |
|
35 | 35 | foreach ($this->articleMapper->getCategories($articleId) as $category) { |
36 | - $categories[] = $category->category_id; |
|
36 | + $categories[ ] = $category->category_id; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $categories; |
@@ -41,6 +41,6 @@ discard block |
||
41 | 41 | |
42 | 42 | public function delete($articleId) |
43 | 43 | { |
44 | - $this->articleMapper->delete(['article_uuid' => $articleId]); |
|
44 | + $this->articleMapper->delete([ 'article_uuid' => $articleId ]); |
|
45 | 45 | } |
46 | 46 | } |
@@ -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), |