@@ -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 | * |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Model for handling requests dealing with the manga list |
| 25 | 25 | */ |
| 26 | -class Manga extends API |
|
| 27 | -{ |
|
| 26 | +class Manga extends API { |
|
| 28 | 27 | |
| 29 | 28 | const READING = 'Reading'; |
| 30 | 29 | const PLAN_TO_READ = 'Plan to Read'; |
@@ -160,12 +159,14 @@ discard block |
||
| 160 | 159 | self::COMPLETED => [], |
| 161 | 160 | ]; |
| 162 | 161 | |
| 163 | - foreach ($data as &$entry) { |
|
| 162 | + foreach ($data as &$entry) |
|
| 163 | + { |
|
| 164 | 164 | $key = $this->status_map[$entry['reading_status']]; |
| 165 | 165 | $output[$key][] = $entry; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - foreach ($output as &$val) { |
|
| 168 | + foreach ($output as &$val) |
|
| 169 | + { |
|
| 169 | 170 | $this->sortByName($val, 'manga'); |
| 170 | 171 | } |
| 171 | 172 | |
@@ -53,7 +53,8 @@ |
||
| 53 | 53 | * Anime constructor. |
| 54 | 54 | * @param ContainerInterface $container |
| 55 | 55 | */ |
| 56 | - public function __construct(ContainerInterface $container) { |
|
| 56 | + public function __construct(ContainerInterface $container) |
|
| 57 | + { |
|
| 57 | 58 | parent::__construct($container); |
| 58 | 59 | |
| 59 | 60 | $config = $container->get('config'); |
@@ -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 |