@@ -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 @@ |
||
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 @@ |
||
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 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * Hummingbird Anime Client |
4 | 4 | * |
@@ -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 | * 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 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ->get('session') |
66 | 66 | ->getSegment(SESSION_SEGMENT); |
67 | 67 | |
68 | - if ($sessionSegment->get('auth_token') !== null && $url !== K::AUTH_URL) |
|
68 | + if ($sessionSegment->get('auth_token') !== NULL && $url !== K::AUTH_URL) |
|
69 | 69 | { |
70 | 70 | $token = $sessionSegment->get('auth_token'); |
71 | 71 | $request = $request->setAuth('bearer', $token); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function request(string $type, string $url, array $options = []): array |
128 | 128 | { |
129 | - $logger = null; |
|
129 | + $logger = NULL; |
|
130 | 130 | if ($this->getContainer()) |
131 | 131 | { |
132 | 132 | $logger = $this->container->getLogger('kitsu-request'); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | protected function postRequest(...$args): array |
177 | 177 | { |
178 | - $logger = null; |
|
178 | + $logger = NULL; |
|
179 | 179 | if ($this->getContainer()) |
180 | 180 | { |
181 | 181 | $logger = $this->container->getLogger('kitsu-request'); |
@@ -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 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'rewatching' => (bool) $item['attributes']['reconsuming'], |
96 | 96 | 'rewatched' => (int) $item['attributes']['reconsumeCount'], |
97 | 97 | 'user_rating' => ($rating === 0) ? '-' : (int) $rating, |
98 | - 'private' => (bool) $item['attributes']['private'] ?? false, |
|
98 | + 'private' => (bool) $item['attributes']['private'] ?? FALSE, |
|
99 | 99 | ]; |
100 | 100 | } |
101 | 101 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $untransformed = [ |
115 | 115 | 'id' => $item['id'], |
116 | - 'mal_id' => $item['mal_id'] ?? null, |
|
116 | + 'mal_id' => $item['mal_id'] ?? NULL, |
|
117 | 117 | 'data' => [ |
118 | 118 | 'status' => $item['watching_status'], |
119 | 119 | 'reconsuming' => $rewatching, |
@@ -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': |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 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; |
@@ -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", [ |