@@ -61,7 +61,7 @@ |
||
61 | 61 | public function __invoke(Request $request, Response $response, callable $next = null) |
62 | 62 | { |
63 | 63 | $params = $request->getQueryParams(); |
64 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
64 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
65 | 65 | $videos = $this->videoService->fetchWebArticles($page, 5); |
66 | 66 | $category = $this->categoryService->getCategoryBySlug('videos'); |
67 | 67 |
@@ -58,6 +58,6 @@ |
||
58 | 58 | $page = $this->pageService->getHomepage(); |
59 | 59 | |
60 | 60 | return new HtmlResponse($this->template->render('web::home', |
61 | - ['page' => $page, 'layout' => 'layout/web'])); |
|
61 | + [ 'page' => $page, 'layout' => 'layout/web' ])); |
|
62 | 62 | } |
63 | 63 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | callable $next = null |
66 | 66 | ) { |
67 | 67 | $params = $request->getQueryParams(); |
68 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
68 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
69 | 69 | $futureEvents = $this->eventService->fetchFutureEvents(); |
70 | 70 | $pastEvents = $this->eventService->fetchPastEventsPagination($page, 10); |
71 | 71 | $category = $this->categoryService->getCategoryBySlug('events'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | namespace Web\Action; |
5 | 5 | |
6 | 6 | use Article\Service\PostService; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | callable $next = null |
60 | 60 | ) { |
61 | 61 | $params = $request->getQueryParams(); |
62 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
62 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
63 | 63 | $urlSlug = $request->getAttribute('category'); |
64 | 64 | $categories = $this->categoryService->getCategories(true); |
65 | 65 | $category = $this->categoryService->getCategoryBySlug($urlSlug); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | namespace Web\Factory\Action; |
5 | 5 | |
6 | 6 | use Article\Service\PostService; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Meetup; |
4 | 4 | |
5 | 5 | class ConfigProvider |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Meetup; |
4 | 4 | |
5 | 5 | use GuzzleHttp\Client; |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | public function getMeetupAttendees($eventUrl) |
35 | 35 | { |
36 | 36 | if (strpos($eventUrl, 'meetup.com') === false) { |
37 | - return []; |
|
37 | + return [ ]; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | try { |
41 | 41 | $parts = explode('/', $eventUrl); |
42 | - $meetupId = $parts[count($parts) - 2]; |
|
42 | + $meetupId = $parts[ count($parts) - 2 ]; |
|
43 | 43 | $uri = sprintf(self::API_URL, $meetupId, $this->key); |
44 | 44 | $request = new Request('GET', $uri); |
45 | 45 | $response = $this->httpClient->send($request); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | return $attendees; |
51 | 51 | } catch (\Exception $e) { |
52 | - return []; |
|
52 | + return [ ]; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | namespace Meetup; |
4 | 4 | |
5 | 5 | use Interop\Container\ContainerInterface; |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function __invoke(ContainerInterface $container): MeetupApiService |
16 | 16 | { |
17 | - $config = $container->get('config')['meetupApi']; |
|
17 | + $config = $container->get('config')[ 'meetupApi' ]; |
|
18 | 18 | |
19 | - return new MeetupApiService($config['key']); |
|
19 | + return new MeetupApiService($config[ 'key' ]); |
|
20 | 20 | } |
21 | 21 | } |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | |
33 | 33 | public function get($id) |
34 | 34 | { |
35 | - return $this->select(['category_id' => $id])->current(); |
|
35 | + return $this->select([ 'category_id' => $id ])->current(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function getPaginationSelect() |
39 | 39 | { |
40 | - $select = $this->getSql()->select()->order(['name' => 'asc']); |
|
40 | + $select = $this->getSql()->select()->order([ 'name' => 'asc' ]); |
|
41 | 41 | |
42 | 42 | return $select; |
43 | 43 | } |
@@ -45,21 +45,21 @@ discard block |
||
45 | 45 | public function getCategoryPostsSelect($categoryId = null, $limit = null) |
46 | 46 | { |
47 | 47 | $select = $this->getSql()->select() |
48 | - ->columns(['category_name' => 'name', 'category_slug' => 'slug']) |
|
48 | + ->columns([ 'category_name' => 'name', 'category_slug' => 'slug' ]) |
|
49 | 49 | ->join( |
50 | 50 | 'articles', |
51 | 51 | 'articles.category_uuid = category.category_uuid', |
52 | - ['article_id', 'slug', 'admin_user_uuid', 'published_at'] |
|
53 | - )->join('article_posts', 'article_posts.article_uuid = articles.article_uuid', ['*'], 'right') |
|
52 | + [ 'article_id', 'slug', 'admin_user_uuid', 'published_at' ] |
|
53 | + )->join('article_posts', 'article_posts.article_uuid = articles.article_uuid', [ '*' ], 'right') |
|
54 | 54 | ->join( |
55 | 55 | 'admin_users', |
56 | 56 | 'admin_users.admin_user_uuid = articles.admin_user_uuid', |
57 | - ['admin_user_id', 'first_name', 'last_name', 'face_img'] |
|
58 | - )->where(['articles.status' => 1]) |
|
59 | - ->order(['published_at' => 'desc']); |
|
57 | + [ 'admin_user_id', 'first_name', 'last_name', 'face_img' ] |
|
58 | + )->where([ 'articles.status' => 1 ]) |
|
59 | + ->order([ 'published_at' => 'desc' ]); |
|
60 | 60 | |
61 | 61 | if ($categoryId) { |
62 | - $select->where(['category_id' => $categoryId]); |
|
62 | + $select->where([ 'category_id' => $categoryId ]); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if ($limit) { |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | $select->where->notEqualTo('slug', 'events'); |
92 | 92 | |
93 | 93 | if ($inHomepage !== null) { |
94 | - $select->where(['is_in_homepage' => $inHomepage]); |
|
94 | + $select->where([ 'is_in_homepage' => $inHomepage ]); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | if ($inCategoryList !== null) { |
98 | - $select->where(['is_in_category_list' => $inCategoryList]); |
|
98 | + $select->where([ 'is_in_category_list' => $inCategoryList ]); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if ($limit) { |