@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Newsletter\Service; |
6 | 6 |
@@ -15,14 +15,14 @@ |
||
15 | 15 | |
16 | 16 | public function registerNew($email) |
17 | 17 | { |
18 | - if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
18 | + if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
19 | 19 | throw new \Exception('Email is not valid!', 400); |
20 | 20 | } |
21 | 21 | |
22 | - $current = $this->newsletterMapper->select(['email' => $email])->current(); |
|
22 | + $current = $this->newsletterMapper->select([ 'email' => $email ])->current(); |
|
23 | 23 | |
24 | - if(!$current) { |
|
25 | - return $this->newsletterMapper->insert(['email' => $email]); |
|
24 | + if (!$current) { |
|
25 | + return $this->newsletterMapper->insert([ 'email' => $email ]); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | return [ |
10 | 10 | 'templates' => [ |
11 | 11 | 'paths' => [ |
12 | - 'newsletter' => [__DIR__ . '/../templates/newsletter'], |
|
12 | + 'newsletter' => [ __DIR__ . '/../templates/newsletter' ], |
|
13 | 13 | ], |
14 | 14 | ], |
15 | 15 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'name' => 'newsletter-post', |
27 | 27 | 'path' => '/newsletter', |
28 | 28 | 'middleware' => Web\Action\HandlePostAction::class, |
29 | - 'allowed_methods' => ['POST'], |
|
29 | + 'allowed_methods' => [ 'POST' ], |
|
30 | 30 | ], |
31 | 31 | ], |
32 | 32 | ]; |
@@ -7,9 +7,9 @@ |
||
7 | 7 | |
8 | 8 | public function change() |
9 | 9 | { |
10 | - $this->table('newsletter', ['id' => false]) |
|
10 | + $this->table('newsletter', [ 'id' => false ]) |
|
11 | 11 | ->addColumn('email', 'text') |
12 | - ->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP']) |
|
12 | + ->addColumn('created_at', 'timestamp', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
13 | 13 | ->create(); |
14 | 14 | } |
15 | 15 | } |
@@ -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 | |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | { |
64 | 64 | $eventSlug = $request->getAttribute('event_slug'); |
65 | 65 | $event = $this->eventService->fetchEventBySlug($eventSlug); |
66 | - $attendees = []; |
|
66 | + $attendees = [ ]; |
|
67 | 67 | |
68 | 68 | // Fetch going ppl |
69 | - if(strpos($event->event_url, 'meetup.com') !== false) { |
|
69 | + if (strpos($event->event_url, 'meetup.com') !== false) { |
|
70 | 70 | $parts = explode('/', $event->event_url); |
71 | - $attendees = $this->meetupService->getMeetupAttendees($parts[count($parts) - 2]); |
|
71 | + $attendees = $this->meetupService->getMeetupAttendees($parts[ count($parts) - 2 ]); |
|
72 | 72 | shuffle($attendees); |
73 | 73 | } |
74 | 74 |
@@ -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,13 +34,13 @@ discard block |
||
34 | 34 | public function getPaginationSelect($isActive = null) |
35 | 35 | { |
36 | 36 | $select = $this->getSql()->select() |
37 | - ->join('articles', 'article_videos.article_uuid = articles.article_uuid', ['slug', 'published_at', 'status', 'article_id']) |
|
38 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['admin_user_id', 'first_name', 'last_name']) |
|
39 | - ->where(['articles.type' => ArticleType::VIDEO]) |
|
40 | - ->order(['articles.created_at' => 'desc']); |
|
37 | + ->join('articles', 'article_videos.article_uuid = articles.article_uuid', [ 'slug', 'published_at', 'status', 'article_id' ]) |
|
38 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'admin_user_id', 'first_name', 'last_name' ]) |
|
39 | + ->where([ 'articles.type' => ArticleType::VIDEO ]) |
|
40 | + ->order([ 'articles.created_at' => 'desc' ]); |
|
41 | 41 | |
42 | - if($isActive !== null) { |
|
43 | - $select->where(['articles.status' => (int)$isActive]); |
|
42 | + if ($isActive !== null) { |
|
43 | + $select->where([ 'articles.status' => (int) $isActive ]); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return $select; |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | public function get($id) |
50 | 50 | { |
51 | 51 | $select = $this->getSql()->select() |
52 | - ->columns(['title', 'body', 'lead', 'featured_img', 'main_img', 'video_url', 'sub_title']) |
|
52 | + ->columns([ 'title', 'body', 'lead', 'featured_img', 'main_img', 'video_url', 'sub_title' ]) |
|
53 | 53 | ->join('articles', 'article_videos.article_uuid = articles.article_uuid') |
54 | 54 | ->join('category', 'category.category_uuid = articles.category_uuid', |
55 | - ['category_slug' => 'slug', 'category_name' => 'name', 'category_id'], 'left') |
|
56 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['admin_user_id'], 'left') |
|
57 | - ->where(['articles.article_id' => $id]); |
|
55 | + [ 'category_slug' => 'slug', 'category_name' => 'name', 'category_id' ], 'left') |
|
56 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'admin_user_id' ], 'left') |
|
57 | + ->where([ 'articles.article_id' => $id ]); |
|
58 | 58 | |
59 | 59 | return $this->selectWith($select)->current(); |
60 | 60 | } |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | public function getLatest($limit = 50) |
63 | 63 | { |
64 | 64 | $select = $this->getSql()->select() |
65 | - ->join('articles', 'article_videos.article_uuid = articles.article_uuid', ['article_id', 'slug', 'published_at']) |
|
66 | - ->where(['articles.status' => 1]) |
|
67 | - ->order(['published_at' => 'desc']) |
|
65 | + ->join('articles', 'article_videos.article_uuid = articles.article_uuid', [ 'article_id', 'slug', 'published_at' ]) |
|
66 | + ->where([ 'articles.status' => 1 ]) |
|
67 | + ->order([ 'published_at' => 'desc' ]) |
|
68 | 68 | ->limit($limit); |
69 | 69 | |
70 | 70 | return $this->selectWith($select); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $select = $this->getSql()->select() |
76 | 76 | ->join('articles', 'article_videos.article_uuid = articles.article_uuid') |
77 | - ->where(['articles.slug' => $slug]); |
|
77 | + ->where([ 'articles.slug' => $slug ]); |
|
78 | 78 | |
79 | 79 | return $this->selectWith($select)->current(); |
80 | 80 | } |