@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Hummingbird Anime Client |
4 | 4 | * |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $this->setContainer($container); |
92 | 92 | $auraUrlGenerator = $container->get('aura-router')->getGenerator(); |
93 | 93 | $urlGenerator = $container->get('url-generator'); |
94 | - $this->cache = $container->get('cache'); |
|
94 | + $this->cache = $container->get('cache'); |
|
95 | 95 | $this->config = $container->get('config'); |
96 | 96 | $this->request = $container->get('request'); |
97 | 97 | $this->response = $container->get('response'); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Hummingbird Anime Client |
4 | 4 | * |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if ($key === 'config') |
54 | 54 | { |
55 | - foreach($config as $name => $value) |
|
55 | + foreach ($config as $name => $value) |
|
56 | 56 | { |
57 | 57 | $output[$name] = $value; |
58 | 58 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | ]; |
88 | 88 | |
89 | 89 | $data = ($status !== 'all') |
90 | - ? [$map[$status] => $this->model->getList($map[$status]) ] |
|
90 | + ? [$map[$status] => $this->model->getList($map[$status])] |
|
91 | 91 | : $this->model->getList('All'); |
92 | 92 | |
93 | 93 | $this->outputHTML('manga/' . $view_map[$view], [ |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | foreach ($raw_status_list as $status_item) |
187 | 187 | { |
188 | - $statuses[$status_item] = (string) $this->string($status_item) |
|
188 | + $statuses[$status_item] = (string)$this->string($status_item) |
|
189 | 189 | ->underscored() |
190 | 190 | ->humanize() |
191 | 191 | ->titleize(); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public static function inlineRawIncludes(array &$data, string $key): array |
46 | 46 | { |
47 | - foreach($data['data'] as $i => &$item) |
|
47 | + foreach ($data['data'] as $i => &$item) |
|
48 | 48 | { |
49 | 49 | $item[$key] = $data['included'][$i]; |
50 | 50 | } |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | // Duplicate the item for the output |
71 | 71 | $inlined[$key][$itemId] = $item; |
72 | 72 | |
73 | - foreach($item['relationships'] as $type => $ids) |
|
73 | + foreach ($item['relationships'] as $type => $ids) |
|
74 | 74 | { |
75 | 75 | $inlined[$key][$itemId]['relationships'][$type] = []; |
76 | - foreach($ids as $id) |
|
76 | + foreach ($ids as $id) |
|
77 | 77 | { |
78 | 78 | $inlined[$key][$itemId]['relationships'][$type][$id] = $included[$type][$id]; |
79 | 79 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $organized = []; |
127 | 127 | |
128 | - foreach($relationships as $key => $data) |
|
128 | + foreach ($relationships as $key => $data) |
|
129 | 129 | { |
130 | 130 | if ( ! array_key_exists('data', $data)) |
131 | 131 | { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $data = $this->getRequest("anime/{$kitsuAnimeId}", $options); |
185 | 185 | $mappings = array_column($data['included'], 'attributes'); |
186 | 186 | |
187 | - foreach($mappings as $map) |
|
187 | + foreach ($mappings as $map) |
|
188 | 188 | { |
189 | 189 | if ($map['externalSite'] === 'myanimelist/anime') |
190 | 190 | { |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $included = JsonAPI::organizeIncludes($data['included']); |
265 | 265 | $included = JsonAPI::inlineIncludedRelationships($included, 'anime'); |
266 | 266 | |
267 | - foreach($data['data'] as $i => &$item) |
|
267 | + foreach ($data['data'] as $i => &$item) |
|
268 | 268 | { |
269 | 269 | $item['included'] = $included; |
270 | 270 | } |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | 'body' => $response->getBody(), |
410 | 410 | ]; |
411 | 411 | } |
412 | - catch(ClientException $e) |
|
412 | + catch (ClientException $e) |
|
413 | 413 | { |
414 | 414 | return [ |
415 | 415 | 'statusCode' => $e->getResponse()->getStatusCode(), |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $response = $this->getResponse($type, $url, $options); |
141 | 141 | |
142 | - if ((int) $response->getStatusCode() > 299 || (int) $response->getStatusCode() < 200) |
|
142 | + if ((int)$response->getStatusCode() > 299 || (int)$response->getStatusCode() < 200) |
|
143 | 143 | { |
144 | 144 | if ($logger) |
145 | 145 | { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $response = $this->getResponse('POST', ...$args); |
190 | 190 | $validResponseCodes = [200, 201]; |
191 | 191 | |
192 | - if ( ! in_array((int) $response->getStatusCode(), $validResponseCodes)) |
|
192 | + if ( ! in_array((int)$response->getStatusCode(), $validResponseCodes)) |
|
193 | 193 | { |
194 | 194 | if ($logger) |
195 | 195 | { |
@@ -209,6 +209,6 @@ discard block |
||
209 | 209 | protected function deleteRequest(...$args): bool |
210 | 210 | { |
211 | 211 | $response = $this->getResponse('DELETE', ...$args); |
212 | - return ((int) $response->getStatusCode() === 204); |
|
212 | + return ((int)$response->getStatusCode() === 204); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | \ No newline at end of file |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Anime List Client |
4 | 4 | * |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $genres = array_column($anime['relationships']['genres'], 'name') ?? []; |
42 | 42 | sort($genres); |
43 | 43 | |
44 | - $rating = (int) 2 * $item['attributes']['rating']; |
|
44 | + $rating = (int)2 * $item['attributes']['rating']; |
|
45 | 45 | |
46 | - $total_episodes = array_key_exists('episodeCount', $anime) && (int) $anime['episodeCount'] !== 0 |
|
47 | - ? (int) $anime['episodeCount'] |
|
46 | + $total_episodes = array_key_exists('episodeCount', $anime) && (int)$anime['episodeCount'] !== 0 |
|
47 | + ? (int)$anime['episodeCount'] |
|
48 | 48 | : '-'; |
49 | 49 | |
50 | 50 | $MALid = NULL; |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | 'id' => $item['id'], |
70 | 70 | 'mal_id' => $MALid, |
71 | 71 | 'episodes' => [ |
72 | - 'watched' => (int) $item['attributes']['progress'] !== '0' |
|
73 | - ? (int) $item['attributes']['progress'] |
|
72 | + 'watched' => (int)$item['attributes']['progress'] !== '0' |
|
73 | + ? (int)$item['attributes']['progress'] |
|
74 | 74 | : '-', |
75 | 75 | 'total' => $total_episodes, |
76 | 76 | 'length' => $anime['episodeLength'], |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | ], |
93 | 93 | 'watching_status' => $item['attributes']['status'], |
94 | 94 | 'notes' => $item['attributes']['notes'], |
95 | - 'rewatching' => (bool) $item['attributes']['reconsuming'], |
|
96 | - 'rewatched' => (int) $item['attributes']['reconsumeCount'], |
|
97 | - 'user_rating' => ($rating === 0) ? '-' : (int) $rating, |
|
98 | - 'private' => (bool) $item['attributes']['private'] ?? false, |
|
95 | + 'rewatching' => (bool)$item['attributes']['reconsuming'], |
|
96 | + 'rewatched' => (int)$item['attributes']['reconsumeCount'], |
|
97 | + 'user_rating' => ($rating === 0) ? '-' : (int)$rating, |
|
98 | + 'private' => (bool)$item['attributes']['private'] ?? false, |
|
99 | 99 | ]; |
100 | 100 | } |
101 | 101 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ] |
126 | 126 | ]; |
127 | 127 | |
128 | - if ((int) $untransformed['data']['rating'] === 0) |
|
128 | + if ((int)$untransformed['data']['rating'] === 0) |
|
129 | 129 | { |
130 | 130 | unset($untransformed['data']['rating']); |
131 | 131 | } |