@@ -6,21 +6,21 @@ |
||
6 | 6 | { |
7 | 7 | public function up() |
8 | 8 | { |
9 | - $this->table('articles', ['id' => false, 'primary_key' => 'article_uuid']) |
|
10 | - ->addColumn('article_uuid', 'binary', ['limit' => 16]) |
|
9 | + $this->table('articles', [ 'id' => false, 'primary_key' => 'article_uuid' ]) |
|
10 | + ->addColumn('article_uuid', 'binary', [ 'limit' => 16 ]) |
|
11 | 11 | ->addColumn('article_id', 'text') |
12 | - ->addColumn('slug', 'text', ['null' => true]) |
|
13 | - ->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP']) |
|
14 | - ->addColumn('published_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP']) |
|
12 | + ->addColumn('slug', 'text', [ 'null' => true ]) |
|
13 | + ->addColumn('created_at', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
14 | + ->addColumn('published_at', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
15 | 15 | ->addColumn('type', 'integer')// see Core\Entity\ArticleType |
16 | 16 | ->addColumn('status', 'integer')// active, not active, ... |
17 | - ->addColumn('admin_user_uuid', 'binary', ['limit' => 16]) |
|
18 | - ->addColumn('is_wysiwyg_editor', 'boolean', ['default' => false]) |
|
19 | - ->addColumn('category_uuid', 'binary', ['limit' => 16]) |
|
20 | - ->addForeignKey('category_uuid', 'category', 'category_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
21 | - ->addForeignKey('admin_user_uuid', 'admin_users', 'admin_user_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
22 | - ->addIndex('type', ['name' => 'type_INDEX']) |
|
23 | - ->addIndex('published_at', ['name' => 'published_at_INDEX']) |
|
17 | + ->addColumn('admin_user_uuid', 'binary', [ 'limit' => 16 ]) |
|
18 | + ->addColumn('is_wysiwyg_editor', 'boolean', [ 'default' => false ]) |
|
19 | + ->addColumn('category_uuid', 'binary', [ 'limit' => 16 ]) |
|
20 | + ->addForeignKey('category_uuid', 'category', 'category_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
21 | + ->addForeignKey('admin_user_uuid', 'admin_users', 'admin_user_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
22 | + ->addIndex('type', [ 'name' => 'type_INDEX' ]) |
|
23 | + ->addIndex('published_at', [ 'name' => 'published_at_INDEX' ]) |
|
24 | 24 | ->create(); |
25 | 25 | } |
26 | 26 |
@@ -10,16 +10,16 @@ discard block |
||
10 | 10 | { |
11 | 11 | public function up() |
12 | 12 | { |
13 | - $this->table('article_posts', ['id' => false]) |
|
14 | - ->addColumn('article_uuid', 'binary', ['limit' => 16]) |
|
13 | + $this->table('article_posts', [ 'id' => false ]) |
|
14 | + ->addColumn('article_uuid', 'binary', [ 'limit' => 16 ]) |
|
15 | 15 | ->addColumn('title', 'text') |
16 | 16 | ->addColumn('body', 'text') |
17 | 17 | ->addColumn('lead', 'text') |
18 | - ->addColumn('featured_img', 'text', ['null' => true]) |
|
19 | - ->addColumn('main_img', 'text', ['null' => true]) |
|
20 | - ->addColumn('has_layout', 'boolean', ['default' => true]) |
|
21 | - ->addColumn('is_homepage', 'boolean', ['default' => false]) |
|
22 | - ->addForeignKey('article_uuid', 'articles', 'article_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
18 | + ->addColumn('featured_img', 'text', [ 'null' => true ]) |
|
19 | + ->addColumn('main_img', 'text', [ 'null' => true ]) |
|
20 | + ->addColumn('has_layout', 'boolean', [ 'default' => true ]) |
|
21 | + ->addColumn('is_homepage', 'boolean', [ 'default' => false ]) |
|
22 | + ->addForeignKey('article_uuid', 'articles', 'article_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
23 | 23 | ->create(); |
24 | 24 | |
25 | 25 | // $this->insertDummyData(); |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | |
33 | 33 | private function insertDummyData() |
34 | 34 | { |
35 | - $ids = []; |
|
35 | + $ids = [ ]; |
|
36 | 36 | $rows = $this->fetchAll('select admin_user_uuid from admin_users;'); |
37 | - foreach($rows as $r) { |
|
38 | - $ids[] = $r['admin_user_uuid']; |
|
37 | + foreach ($rows as $r) { |
|
38 | + $ids[ ] = $r[ 'admin_user_uuid' ]; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $faker = Faker\Factory::create(); |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | $count = rand(25, 300); |
44 | 44 | |
45 | 45 | // Download N images and set it randomly to posts |
46 | - for($i = 0; $i < 5; $i++) { |
|
46 | + for ($i = 0; $i < 5; $i++) { |
|
47 | 47 | $image = $faker->image(); |
48 | 48 | $destination = $upload->getPath(basename($image)); |
49 | 49 | rename($image, $destination); |
50 | - $mainImg[] = substr($destination, strlen('/var/www/unfinished/public')); |
|
50 | + $mainImg[ ] = substr($destination, strlen('/var/www/unfinished/public')); |
|
51 | 51 | |
52 | 52 | $image = $faker->image(); |
53 | 53 | $destination = $upload->getPath(basename($image)); |
54 | 54 | rename($image, $destination); |
55 | - $featuredImg[] = substr($destination, strlen('/var/www/unfinished/public')); |
|
55 | + $featuredImg[ ] = substr($destination, strlen('/var/www/unfinished/public')); |
|
56 | 56 | } |
57 | 57 | |
58 | - for($i = 0; $i < $count; $i++) { |
|
58 | + for ($i = 0; $i < $count; $i++) { |
|
59 | 59 | $id = $faker->uuid; |
60 | 60 | $mysqluuid = (new Uuid($id))->toFormat(new Binary()); |
61 | 61 | $title = $faker->sentence(7, 20); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'article_id' => $id, |
66 | 66 | 'slug' => strtolower(trim(preg_replace('~[^\pL\d]+~u', '-', $title), '-')), |
67 | 67 | 'status' => 1, |
68 | - 'admin_user_uuid' => $ids[array_rand($ids)], |
|
68 | + 'admin_user_uuid' => $ids[ array_rand($ids) ], |
|
69 | 69 | 'type' => ArticleType::POST |
70 | 70 | ]; |
71 | 71 | |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | 'title' => $title, |
75 | 75 | 'body' => $faker->paragraph(15), |
76 | 76 | 'lead' => $faker->paragraph(5), |
77 | - 'main_img' => $mainImg[array_rand($mainImg)], |
|
78 | - 'featured_img' => $featuredImg[array_rand($featuredImg)] |
|
77 | + 'main_img' => $mainImg[ array_rand($mainImg) ], |
|
78 | + 'featured_img' => $featuredImg[ array_rand($featuredImg) ] |
|
79 | 79 | ]; |
80 | 80 | |
81 | 81 | $this->insert('articles', $article); |
@@ -10,16 +10,16 @@ discard block |
||
10 | 10 | { |
11 | 11 | public function up() |
12 | 12 | { |
13 | - $this->table('article_videos', ['id' => false]) |
|
14 | - ->addColumn('article_uuid', 'binary', ['limit' => 16]) |
|
13 | + $this->table('article_videos', [ 'id' => false ]) |
|
14 | + ->addColumn('article_uuid', 'binary', [ 'limit' => 16 ]) |
|
15 | 15 | ->addColumn('title', 'text') |
16 | - ->addColumn('sub_title', 'text', ['null' => true]) |
|
16 | + ->addColumn('sub_title', 'text', [ 'null' => true ]) |
|
17 | 17 | ->addColumn('body', 'text') |
18 | 18 | ->addColumn('lead', 'text') |
19 | 19 | ->addColumn('video_url', 'text') |
20 | - ->addColumn('featured_img', 'text', ['null' => true]) |
|
21 | - ->addColumn('main_img', 'text', ['null' => true]) |
|
22 | - ->addForeignKey('article_uuid', 'articles', 'article_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
20 | + ->addColumn('featured_img', 'text', [ 'null' => true ]) |
|
21 | + ->addColumn('main_img', 'text', [ 'null' => true ]) |
|
22 | + ->addForeignKey('article_uuid', 'articles', 'article_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
23 | 23 | ->create(); |
24 | 24 | |
25 | 25 | // $this->insertDummyData(); |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | |
33 | 33 | private function insertDummyData() |
34 | 34 | { |
35 | - $ids = []; |
|
35 | + $ids = [ ]; |
|
36 | 36 | $rows = $this->fetchAll('select admin_user_uuid from admin_users;'); |
37 | - foreach($rows as $r) { |
|
38 | - $ids[] = $r['admin_user_uuid']; |
|
37 | + foreach ($rows as $r) { |
|
38 | + $ids[ ] = $r[ 'admin_user_uuid' ]; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $faker = Faker\Factory::create(); |
@@ -48,19 +48,19 @@ discard block |
||
48 | 48 | ]; |
49 | 49 | |
50 | 50 | // Download N images and set it randomly to posts |
51 | - for($i = 0; $i < 5; $i++) { |
|
51 | + for ($i = 0; $i < 5; $i++) { |
|
52 | 52 | $image = $faker->image(); |
53 | 53 | $destination = $upload->getPath(basename($image)); |
54 | 54 | rename($image, $destination); |
55 | - $mainImg[] = substr($destination, strlen('/var/www/unfinished/public')); |
|
55 | + $mainImg[ ] = substr($destination, strlen('/var/www/unfinished/public')); |
|
56 | 56 | |
57 | 57 | $image = $faker->image(); |
58 | 58 | $destination = $upload->getPath(basename($image)); |
59 | 59 | rename($image, $destination); |
60 | - $featuredImg[] = substr($destination, strlen('/var/www/unfinished/public')); |
|
60 | + $featuredImg[ ] = substr($destination, strlen('/var/www/unfinished/public')); |
|
61 | 61 | } |
62 | 62 | |
63 | - for($i = 0; $i < $count; $i++) { |
|
63 | + for ($i = 0; $i < $count; $i++) { |
|
64 | 64 | $id = $faker->uuid; |
65 | 65 | $mysqluuid = (new Uuid($id))->toFormat(new Binary()); |
66 | 66 | $title = $faker->sentence(7, 20); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'article_id' => $id, |
71 | 71 | 'slug' => strtolower(trim(preg_replace('~[^\pL\d]+~u', '-', $title), '-')), |
72 | 72 | 'status' => 1, |
73 | - 'admin_user_uuid' => $ids[array_rand($ids)], |
|
73 | + 'admin_user_uuid' => $ids[ array_rand($ids) ], |
|
74 | 74 | 'type' => ArticleType::POST |
75 | 75 | ]; |
76 | 76 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | 'title' => $title, |
80 | 80 | 'body' => $faker->paragraph(15), |
81 | 81 | 'lead' => $faker->paragraph(5), |
82 | - 'main_img' => $mainImg[array_rand($mainImg)], |
|
83 | - 'featured_img' => $featuredImg[array_rand($featuredImg)], |
|
84 | - 'video_url' => $embedCodes[rand(0, 2)] |
|
82 | + 'main_img' => $mainImg[ array_rand($mainImg) ], |
|
83 | + 'featured_img' => $featuredImg[ array_rand($featuredImg) ], |
|
84 | + 'video_url' => $embedCodes[ rand(0, 2) ] |
|
85 | 85 | ]; |
86 | 86 | |
87 | 87 | $this->insert('articles', $article); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Article\Mapper; |
5 | 5 | |
@@ -34,21 +34,21 @@ discard block |
||
34 | 34 | public function getPaginationSelect() |
35 | 35 | { |
36 | 36 | return $this->getSql()->select() |
37 | - ->columns(['title', 'body', 'lead', 'featured_img', 'main_img', 'is_homepage']) |
|
37 | + ->columns([ 'title', 'body', 'lead', 'featured_img', 'main_img', 'is_homepage' ]) |
|
38 | 38 | ->join('articles', 'article_posts.article_uuid = articles.article_uuid') |
39 | - ->join('category', 'articles.category_uuid = category.category_uuid', ['category_name' => 'name'], 'left') |
|
40 | - ->where(['articles.type' => ArticleType::POST]) |
|
41 | - ->order(['created_at' => 'desc']); |
|
39 | + ->join('category', 'articles.category_uuid = category.category_uuid', [ 'category_name' => 'name' ], 'left') |
|
40 | + ->where([ 'articles.type' => ArticleType::POST ]) |
|
41 | + ->order([ 'created_at' => 'desc' ]); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function get($id) |
45 | 45 | { |
46 | 46 | $select = $this->getSql()->select() |
47 | - ->columns(['title', 'body', 'lead', 'featured_img', 'main_img', 'has_layout', 'is_homepage']) |
|
47 | + ->columns([ 'title', 'body', 'lead', 'featured_img', 'main_img', 'has_layout', 'is_homepage' ]) |
|
48 | 48 | ->join('articles', 'article_posts.article_uuid = articles.article_uuid') |
49 | 49 | ->join('category', 'category.category_uuid = articles.category_uuid', |
50 | - ['category_slug' => 'slug', 'category_name' => 'name', 'category_id'], 'left') |
|
51 | - ->where(['articles.article_id' => $id]); |
|
50 | + [ 'category_slug' => 'slug', 'category_name' => 'name', 'category_id' ], 'left') |
|
51 | + ->where([ 'articles.article_id' => $id ]); |
|
52 | 52 | |
53 | 53 | return $this->selectWith($select)->current(); |
54 | 54 | } |
@@ -57,15 +57,15 @@ discard block |
||
57 | 57 | { |
58 | 58 | $select = $this->getSql()->select() |
59 | 59 | ->join('articles', 'article_posts.article_uuid = articles.article_uuid') |
60 | - ->join('category', 'category.category_uuid = articles.category_uuid', ['category_slug' => 'slug']) |
|
60 | + ->join('category', 'category.category_uuid = articles.category_uuid', [ 'category_slug' => 'slug' ]) |
|
61 | 61 | ->limit(1); |
62 | 62 | |
63 | - if($direction > 0) { |
|
63 | + if ($direction > 0) { |
|
64 | 64 | $select->where->greaterThan('published_at', $publishedAt); |
65 | - $select->order(['published_at' => 'asc']); |
|
66 | - } elseif($direction < 0) { |
|
65 | + $select->order([ 'published_at' => 'asc' ]); |
|
66 | + } elseif ($direction < 0) { |
|
67 | 67 | $select->where->lessThan('published_at', $publishedAt); |
68 | - $select->order(['published_at' => 'desc']); |
|
68 | + $select->order([ 'published_at' => 'desc' ]); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | return $this->selectWith($select)->current(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $select = $this->getSql()->select() |
77 | 77 | ->join('articles', 'article_posts.article_uuid = articles.article_uuid') |
78 | - ->where(['article_posts.is_homepage' => true, 'articles.status' => 1]); |
|
78 | + ->where([ 'article_posts.is_homepage' => true, 'articles.status' => 1 ]); |
|
79 | 79 | |
80 | 80 | return $this->selectWith($select)->current(); |
81 | 81 | } |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | public function getBySlug($slug) |
84 | 84 | { |
85 | 85 | $select = $this->getSql()->select() |
86 | - ->columns(['title', 'body', 'lead', 'featured_img', 'main_img']) |
|
86 | + ->columns([ 'title', 'body', 'lead', 'featured_img', 'main_img' ]) |
|
87 | 87 | ->join('articles', 'article_posts.article_uuid = articles.article_uuid') |
88 | - ->join('category', 'category.category_uuid = articles.category_uuid', ['category_name' => 'name', 'category_slug' => 'slug']) |
|
89 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['first_name', 'last_name']) |
|
90 | - ->where(['articles.slug' => $slug, 'articles.status' => 1]); |
|
88 | + ->join('category', 'category.category_uuid = articles.category_uuid', [ 'category_name' => 'name', 'category_slug' => 'slug' ]) |
|
89 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'first_name', 'last_name' ]) |
|
90 | + ->where([ 'articles.slug' => $slug, 'articles.status' => 1 ]); |
|
91 | 91 | |
92 | 92 | return $this->selectWith($select)->current(); |
93 | 93 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | public function getAll() |
96 | 96 | { |
97 | 97 | $select = $this->getSql()->select() |
98 | - ->join('articles', 'article_posts.article_uuid = articles.article_uuid', ['article_id', 'slug']); |
|
98 | + ->join('articles', 'article_posts.article_uuid = articles.article_uuid', [ 'article_id', 'slug' ]); |
|
99 | 99 | |
100 | 100 | return $this->selectWith($select); |
101 | 101 | } |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | { |
105 | 105 | $select = $this->getSql()->select() |
106 | 106 | ->join('articles', 'article_posts.article_uuid = articles.article_uuid') |
107 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['first_name', 'last_name']) |
|
107 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'first_name', 'last_name' ]) |
|
108 | 108 | ->join('category', 'category.category_uuid = articles.category_uuid', |
109 | - ['category_name' => 'name', 'category_id', 'category_slug' => 'slug']) |
|
110 | - ->where(['articles.status' => 1]) |
|
111 | - ->order(['articles.published_at' => 'desc']) |
|
109 | + [ 'category_name' => 'name', 'category_id', 'category_slug' => 'slug' ]) |
|
110 | + ->where([ 'articles.status' => 1 ]) |
|
111 | + ->order([ 'articles.published_at' => 'desc' ]) |
|
112 | 112 | ->limit($limit); |
113 | 113 | |
114 | 114 | return $this->selectWith($select); |
@@ -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 Web\Action; |
6 | 6 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function __invoke(Request $request, Response $response, callable $next = null) |
54 | 54 | { |
55 | 55 | $params = $request->getQueryParams(); |
56 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
56 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
57 | 57 | $futureEvents = $this->eventService->fetchFutureEvents(); |
58 | 58 | $pastEvents = $this->eventService->fetchPastEventsPagination($page, 10); |
59 | 59 |
@@ -19,37 +19,37 @@ 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 | 'name' => 'first_name', |
27 | 27 | 'required' => true, |
28 | - 'filters' => [['name' => 'StringTrim']], |
|
28 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
29 | 29 | 'validators' => [ |
30 | - ['name' => 'NotEmpty'], |
|
31 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 255]] |
|
30 | + [ 'name' => 'NotEmpty' ], |
|
31 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 255 ] ] |
|
32 | 32 | ], |
33 | 33 | ]); |
34 | 34 | |
35 | 35 | $inputFilter->add([ |
36 | 36 | 'name' => 'last_name', |
37 | 37 | 'required' => true, |
38 | - 'filters' => [['name' => 'StringTrim']], |
|
38 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
39 | 39 | 'validators' => [ |
40 | - ['name' => 'NotEmpty'], |
|
41 | - ['name' => 'StringLength', 'options' => ['min' => 2, 'max' => 255]] |
|
40 | + [ 'name' => 'NotEmpty' ], |
|
41 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 2, 'max' => 255 ] ] |
|
42 | 42 | ], |
43 | 43 | ]); |
44 | 44 | |
45 | 45 | $inputFilter->add([ |
46 | 46 | 'name' => 'email', |
47 | 47 | 'required' => true, |
48 | - 'filters' => [['name' => 'StringTrim']], |
|
48 | + 'filters' => [ [ 'name' => 'StringTrim' ] ], |
|
49 | 49 | 'validators' => [ |
50 | - ['name' => 'NotEmpty'], |
|
51 | - ['name' => 'EmailAddress'], |
|
52 | - ['name' => 'dbnorecordexists', 'options' => ['adapter' => $this->adapter, 'table' => 'admin_users', 'field' => 'email']], |
|
50 | + [ 'name' => 'NotEmpty' ], |
|
51 | + [ 'name' => 'EmailAddress' ], |
|
52 | + [ 'name' => 'dbnorecordexists', 'options' => [ 'adapter' => $this->adapter, 'table' => 'admin_users', 'field' => 'email' ] ], |
|
53 | 53 | |
54 | 54 | ], |
55 | 55 | ]); |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | $inputFilter->add([ |
58 | 58 | 'name' => 'introduction', |
59 | 59 | 'required' => false, |
60 | - 'filters' => [['name' => 'StringTrim']] |
|
60 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
61 | 61 | ]); |
62 | 62 | |
63 | 63 | $inputFilter->add([ |
64 | 64 | 'name' => 'biography', |
65 | 65 | 'required' => false, |
66 | - 'filters' => [['name' => 'StringTrim']] |
|
66 | + 'filters' => [ [ 'name' => 'StringTrim' ] ] |
|
67 | 67 | ]); |
68 | 68 | |
69 | 69 | $inputFilter->add([ |
70 | 70 | 'name' => 'password', |
71 | 71 | 'required' => true, |
72 | 72 | 'validators' => [ |
73 | - ['name' => 'NotEmpty'], |
|
74 | - ['name' => 'StringLength', 'options' => ['min' => 7, 'max' => 255]] |
|
73 | + [ 'name' => 'NotEmpty' ], |
|
74 | + [ 'name' => 'StringLength', 'options' => [ 'min' => 7, 'max' => 255 ] ] |
|
75 | 75 | ], |
76 | 76 | ]); |
77 | 77 | |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | 'name' => 'confirm_password', |
80 | 80 | 'required' => true, |
81 | 81 | 'validators' => [ |
82 | - ['name' => 'NotEmpty'], |
|
83 | - ['name' => 'Identical', 'options' => ['token' => 'password']], |
|
82 | + [ 'name' => 'NotEmpty' ], |
|
83 | + [ 'name' => 'Identical', 'options' => [ 'token' => 'password' ] ], |
|
84 | 84 | ], |
85 | 85 | ]); |
86 | 86 | |
87 | 87 | $inputFilter->add([ |
88 | 88 | 'name' => 'status', |
89 | 89 | 'required' => true, |
90 | - 'validators' => [['name' => 'NotEmpty'], ['name' => 'Digits']] |
|
90 | + 'validators' => [ [ 'name' => 'NotEmpty' ], [ 'name' => 'Digits' ] ] |
|
91 | 91 | ]); |
92 | 92 | |
93 | 93 | $this->inputFilter = $inputFilter; |
@@ -8,21 +8,21 @@ |
||
8 | 8 | { |
9 | 9 | public function up() |
10 | 10 | { |
11 | - $this->table('admin_users', ['id' => false, 'primary_key' => 'admin_user_uuid']) |
|
12 | - ->addColumn('admin_user_uuid', 'binary', ['limit' => 16]) |
|
11 | + $this->table('admin_users', [ 'id' => false, 'primary_key' => 'admin_user_uuid' ]) |
|
12 | + ->addColumn('admin_user_uuid', 'binary', [ 'limit' => 16 ]) |
|
13 | 13 | ->addColumn('admin_user_id', 'text') |
14 | 14 | ->addColumn('first_name', 'text') |
15 | 15 | ->addColumn('last_name', 'text') |
16 | - ->addColumn('introduction', 'text', ['null' => true]) |
|
17 | - ->addColumn('biography', 'text', ['null' => true]) |
|
18 | - ->addColumn('email', 'string', ['limit' => 128]) |
|
19 | - ->addColumn('password', 'char', ['limit' => 60]) |
|
20 | - ->addColumn('status', 'integer', ['default' => 0])// 0 => not active, 1 = active |
|
21 | - ->addColumn('face_img', 'text', ['null' => true]) |
|
22 | - ->addColumn('profile_img', 'text', ['null' => true]) |
|
23 | - ->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP']) |
|
24 | - ->addColumn('last_login', 'datetime', ['null' => true]) |
|
25 | - ->addIndex(['email'], ['name' => 'email_INDEX']) |
|
16 | + ->addColumn('introduction', 'text', [ 'null' => true ]) |
|
17 | + ->addColumn('biography', 'text', [ 'null' => true ]) |
|
18 | + ->addColumn('email', 'string', [ 'limit' => 128 ]) |
|
19 | + ->addColumn('password', 'char', [ 'limit' => 60 ]) |
|
20 | + ->addColumn('status', 'integer', [ 'default' => 0 ])// 0 => not active, 1 = active |
|
21 | + ->addColumn('face_img', 'text', [ 'null' => true ]) |
|
22 | + ->addColumn('profile_img', 'text', [ 'null' => true ]) |
|
23 | + ->addColumn('created_at', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
24 | + ->addColumn('last_login', 'datetime', [ 'null' => true ]) |
|
25 | + ->addIndex([ 'email' ], [ 'name' => 'email_INDEX' ]) |
|
26 | 26 | ->create(); |
27 | 27 | |
28 | 28 | $faker = Faker\Factory::create(); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | public function getByIp($ip) |
34 | 34 | { |
35 | - return $this->select(['ip' => $ip]); |
|
35 | + return $this->select([ 'ip' => $ip ]); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function insertRec($data) |
@@ -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 Web\Action; |
6 | 6 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $eventSlug = $request->getAttribute('event_slug'); |
65 | 65 | $event = $this->eventService->fetchEventBySlug($eventSlug); |
66 | 66 | $parts = explode('/', $event->event_url); |
67 | - $attendees = $this->meetupService->getMeetupAttendees($parts[count($parts) - 2]); |
|
67 | + $attendees = $this->meetupService->getMeetupAttendees($parts[ count($parts) - 2 ]); |
|
68 | 68 | |
69 | 69 | return new HtmlResponse($this->template->render('web::event', [ |
70 | 70 | 'layout' => 'layout/web', |