@@ -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, 5); |
| 59 | 59 | |
@@ -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 Article\Mapper; |
| 6 | 6 | |
@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | public function getPaginationSelect($status = null) |
| 37 | 37 | { |
| 38 | 38 | $select = $this->getSql()->select() |
| 39 | - ->columns(['title', 'body', 'longitude', 'latitude']) |
|
| 39 | + ->columns([ 'title', 'body', 'longitude', 'latitude' ]) |
|
| 40 | 40 | ->join('articles', 'article_events.article_uuid = articles.article_uuid') |
| 41 | - ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', ['admin_user_id', 'first_name', 'last_name']) |
|
| 42 | - ->where(['articles.type' => ArticleType::EVENT]) |
|
| 43 | - ->order(['created_at' => 'desc']); |
|
| 41 | + ->join('admin_users', 'admin_users.admin_user_uuid = articles.admin_user_uuid', [ 'admin_user_id', 'first_name', 'last_name' ]) |
|
| 42 | + ->where([ 'articles.type' => ArticleType::EVENT ]) |
|
| 43 | + ->order([ 'created_at' => 'desc' ]); |
|
| 44 | 44 | |
| 45 | - if($status) { |
|
| 46 | - $select->where(['articles.status' => (int)$status]); |
|
| 45 | + if ($status) { |
|
| 46 | + $select->where([ 'articles.status' => (int) $status ]); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $select; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $select = $this->getSql()->select() |
| 55 | 55 | ->join('articles', 'article_events.article_uuid = articles.article_uuid') |
| 56 | - ->where(['articles.article_id' => $id]); |
|
| 56 | + ->where([ 'articles.article_id' => $id ]); |
|
| 57 | 57 | |
| 58 | 58 | return $this->selectWith($select)->current(); |
| 59 | 59 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $select = $this->getSql()->select() |
| 64 | 64 | ->join('articles', 'article_events.article_uuid = articles.article_uuid') |
| 65 | - ->where(['articles.slug' => $slug]); |
|
| 65 | + ->where([ 'articles.slug' => $slug ]); |
|
| 66 | 66 | |
| 67 | 67 | return $this->selectWith($select)->current(); |
| 68 | 68 | } |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | public function getLatest($limit = 50) |
| 71 | 71 | { |
| 72 | 72 | $select = $this->getSql()->select() |
| 73 | - ->join('articles', 'article_events.article_uuid = articles.article_uuid', ['article_id', 'slug', 'published_at']) |
|
| 74 | - ->where(['articles.status' => 1]) |
|
| 75 | - ->order(['published_at' => 'desc']) |
|
| 73 | + ->join('articles', 'article_events.article_uuid = articles.article_uuid', [ 'article_id', 'slug', 'published_at' ]) |
|
| 74 | + ->where([ 'articles.status' => 1 ]) |
|
| 75 | + ->order([ 'published_at' => 'desc' ]) |
|
| 76 | 76 | ->limit($limit); |
| 77 | 77 | |
| 78 | 78 | return $this->selectWith($select); |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | public function getFuture() |
| 82 | 82 | { |
| 83 | 83 | $select = $this->getSql()->select() |
| 84 | - ->where(['articles.status' => 1]) |
|
| 85 | - ->join('articles', 'articles.article_uuid = article_events.article_uuid', ['article_id', 'slug', 'published_at']) |
|
| 84 | + ->where([ 'articles.status' => 1 ]) |
|
| 85 | + ->join('articles', 'articles.article_uuid = article_events.article_uuid', [ 'article_id', 'slug', 'published_at' ]) |
|
| 86 | 86 | ->order(new Expression('rand()')); |
| 87 | 87 | |
| 88 | 88 | $select->where->greaterThanOrEqualTo('end_at', date('Y-m-d H:i:s')); |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | public function getPastSelect() |
| 94 | 94 | { |
| 95 | 95 | $select = $this->getSql()->select() |
| 96 | - ->where(['articles.status' => 1]) |
|
| 97 | - ->join('articles', 'articles.article_uuid = article_events.article_uuid', ['article_id', 'slug', 'published_at']) |
|
| 98 | - ->order(['start_at' => 'desc']); |
|
| 96 | + ->where([ 'articles.status' => 1 ]) |
|
| 97 | + ->join('articles', 'articles.article_uuid = article_events.article_uuid', [ 'article_id', 'slug', 'published_at' ]) |
|
| 98 | + ->order([ 'start_at' => 'desc' ]); |
|
| 99 | 99 | |
| 100 | 100 | $select->where->lessThan('end_at', date('Y-m-d H:i:s')); |
| 101 | 101 | |