@@ -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 | * |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | $params = []; |
| 283 | 283 | |
| 284 | - switch($failure->failedRule) { |
|
| 284 | + switch ($failure->failedRule) { |
|
| 285 | 285 | case 'Aura\Router\Rule\Allows': |
| 286 | 286 | $params = [ |
| 287 | 287 | 'http_code' => 405, |
@@ -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 | * |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $config = loadToml($CONF_DIR); |
| 74 | 74 | $config_array = array_merge($base_config, $config); |
| 75 | 75 | |
| 76 | - $di = function ($config_array) use ($APP_DIR) { |
|
| 76 | + $di = function($config_array) use ($APP_DIR) { |
|
| 77 | 77 | $container = new Container(); |
| 78 | 78 | |
| 79 | 79 | // ------------------------------------------------------------------------- |
@@ -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 | * |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $response = $this->getResponse($type, $url, $options); |
| 136 | 136 | |
| 137 | - if ((int) $response->getStatus() > 299 || (int) $response->getStatus() < 200) |
|
| 137 | + if ((int)$response->getStatus() > 299 || (int)$response->getStatus() < 200) |
|
| 138 | 138 | { |
| 139 | 139 | if ($logger) |
| 140 | 140 | { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $response = $this->getResponse('POST', ...$args); |
| 185 | 185 | $validResponseCodes = [200, 201]; |
| 186 | 186 | |
| 187 | - if ( ! in_array((int) $response->getStatus(), $validResponseCodes)) |
|
| 187 | + if ( ! in_array((int)$response->getStatus(), $validResponseCodes)) |
|
| 188 | 188 | { |
| 189 | 189 | if ($logger) |
| 190 | 190 | { |
@@ -204,6 +204,6 @@ discard block |
||
| 204 | 204 | protected function deleteRequest(...$args): bool |
| 205 | 205 | { |
| 206 | 206 | $response = $this->getResponse('DELETE', ...$args); |
| 207 | - return ((int) $response->getStatus() === 204); |
|
| 207 | + return ((int)$response->getStatus() === 204); |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | \ 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 | |
@@ -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 | * |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $data = $this->getRequest("anime/{$kitsuAnimeId}", $options); |
| 182 | 182 | $mappings = array_column($data['included'], 'attributes'); |
| 183 | 183 | |
| 184 | - foreach($mappings as $map) |
|
| 184 | + foreach ($mappings as $map) |
|
| 185 | 185 | { |
| 186 | 186 | if ($map['externalSite'] === 'myanimelist/anime') |
| 187 | 187 | { |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $included = JsonAPI::organizeIncludes($data['included']); |
| 262 | 262 | $included = JsonAPI::inlineIncludedRelationships($included, 'anime'); |
| 263 | 263 | |
| 264 | - foreach($data['data'] as $i => &$item) |
|
| 264 | + foreach ($data['data'] as $i => &$item) |
|
| 265 | 265 | { |
| 266 | 266 | $item['included'] = $included; |
| 267 | 267 | } |
@@ -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 | * |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $request = $this->requestBuilder |
| 95 | 95 | ->newRequest($type, $url) |
| 96 | - ->setBasicAuth($config->get(['mal','username']), $config->get(['mal','password'])); |
|
| 96 | + ->setBasicAuth($config->get(['mal', 'username']), $config->get(['mal', 'password'])); |
|
| 97 | 97 | |
| 98 | 98 | if (array_key_exists('query', $options)) |
| 99 | 99 | { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $response = $this->getResponse($type, $url, $options); |
| 158 | 158 | |
| 159 | - if ((int) $response->getStatus() > 299 || (int) $response->getStatus() < 200) |
|
| 159 | + if ((int)$response->getStatus() > 299 || (int)$response->getStatus() < 200) |
|
| 160 | 160 | { |
| 161 | 161 | if ($logger) |
| 162 | 162 | { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - return XML::toArray((string) $response->getBody()); |
|
| 167 | + return XML::toArray((string)$response->getBody()); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $response = $this->getResponse('POST', ...$args); |
| 196 | 196 | $validResponseCodes = [200, 201]; |
| 197 | 197 | |
| 198 | - if ( ! in_array((int) $response->getStatus(), $validResponseCodes)) |
|
| 198 | + if ( ! in_array((int)$response->getStatus(), $validResponseCodes)) |
|
| 199 | 199 | { |
| 200 | 200 | if ($logger) |
| 201 | 201 | { |
@@ -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,7 +41,7 @@ discard block |
||
| 41 | 41 | 'data' => [ |
| 42 | 42 | 'status' => self::statusMap[$item['watching_status']], |
| 43 | 43 | 'rating' => $item['user_rating'], |
| 44 | - 'rewatch_value' => (int) $rewatching, |
|
| 44 | + 'rewatch_value' => (int)$rewatching, |
|
| 45 | 45 | 'times_rewatched' => $item['rewatched'], |
| 46 | 46 | 'comments' => $item['notes'], |
| 47 | 47 | 'episode' => $item['episodes_watched'] |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | ] |
| 65 | 65 | ]; |
| 66 | 66 | |
| 67 | - $data =& $item['data']; |
|
| 67 | + $data = & $item['data']; |
|
| 68 | 68 | |
| 69 | - foreach($item['data'] as $key => $value) |
|
| 69 | + foreach ($item['data'] as $key => $value) |
|
| 70 | 70 | { |
| 71 | - switch($key) |
|
| 71 | + switch ($key) |
|
| 72 | 72 | { |
| 73 | 73 | case 'notes': |
| 74 | 74 | $map['data']['comments'] = $value; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | break; |
| 80 | 80 | |
| 81 | 81 | case 'reconsuming': |
| 82 | - $map['data']['enable_rewatching'] = (bool) $value; |
|
| 82 | + $map['data']['enable_rewatching'] = (bool)$value; |
|
| 83 | 83 | break; |
| 84 | 84 | |
| 85 | 85 | case 'reconsumeCount': |
@@ -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 | return $this->requestBuilder->newRequest('POST', "animelist/add/{$id}.xml") |
| 46 | 46 | ->setFormFields($createData) |
| 47 | - ->setBasicAuth($config->get(['mal','username']), $config->get(['mal', 'password'])) |
|
| 47 | + ->setBasicAuth($config->get(['mal', 'username']), $config->get(['mal', 'password'])) |
|
| 48 | 48 | ->getFullRequest(); |
| 49 | 49 | |
| 50 | 50 | /* $response = $this->getResponse('POST', "animelist/add/{$id}.xml", [ |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ->setFormFields([ |
| 63 | 63 | 'id' => $id |
| 64 | 64 | ]) |
| 65 | - ->setBasicAuth($config->get(['mal','username']), $config->get(['mal', 'password'])) |
|
| 65 | + ->setBasicAuth($config->get(['mal', 'username']), $config->get(['mal', 'password'])) |
|
| 66 | 66 | ->getFullRequest(); |
| 67 | 67 | |
| 68 | 68 | /*$response = $this->getResponse('DELETE', "animelist/delete/{$id}.xml", [ |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | 'id' => $id, |
| 92 | 92 | 'data' => $xml |
| 93 | 93 | ]) |
| 94 | - ->setBasicAuth($config->get(['mal','username']), $config->get(['mal', 'password'])) |
|
| 94 | + ->setBasicAuth($config->get(['mal', 'username']), $config->get(['mal', 'password'])) |
|
| 95 | 95 | ->getFullRequest(); |
| 96 | 96 | |
| 97 | 97 | /* return $this->getResponse('POST', "animelist/update/{$id}.xml", [ |
@@ -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 | * |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | if ($key === 'config') |
| 49 | 49 | { |
| 50 | - foreach($config as $name => $value) |
|
| 50 | + foreach ($config as $name => $value) |
|
| 51 | 51 | { |
| 52 | 52 | $output[$name] = $value; |
| 53 | 53 | } |