@@ -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 | } |
@@ -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 | 'rating' => $item['user_rating'] / 2, |
@@ -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 | * |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $genres = []; |
36 | 36 | |
37 | - foreach($item['included'] as $included) |
|
37 | + foreach ($item['included'] as $included) |
|
38 | 38 | { |
39 | 39 | if ($included['type'] === 'genres') |
40 | 40 | { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | ]; |
59 | 59 | } |
60 | 60 | |
61 | - private function count(int $value = null) |
|
61 | + private function count(int $value = NULL) |
|
62 | 62 | { |
63 | 63 | return ((int)$value === 0) |
64 | 64 | ? '-' |
@@ -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 | * |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function transform($item) |
37 | 37 | { |
38 | 38 | /*?><pre><?= print_r($item, TRUE) ?></pre><?php*/ |
39 | - $manga =& $item['manga']; |
|
39 | + $manga = & $item['manga']; |
|
40 | 40 | |
41 | 41 | $rating = (is_numeric($item['attributes']['rating'])) |
42 | 42 | ? intval(2 * $item['attributes']['rating']) |
@@ -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 | * |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ] |
70 | 70 | ]); |
71 | 71 | |
72 | - return $list;//['anime']; |
|
72 | + return $list; //['anime']; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function getListItem(string $listId): array |
@@ -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 @@ 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'] |