@@ -113,8 +113,7 @@ discard block |
||
| 113 | 113 | $res = $http_request->getResponse($url); |
| 114 | 114 | |
| 115 | 115 | $response = json_decode($res->getBody()); |
| 116 | - if (empty($response)) |
|
| 117 | - { |
|
| 116 | + if (empty($response)) { |
|
| 118 | 117 | $this->logger->error('Request Body can not be decode', array('action' => $action, 'query' => $query, 'options' => $options)); |
| 119 | 118 | throw new ServerErrorException(); |
| 120 | 119 | } |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | // Parameters |
| 137 | 136 | $params = []; |
| 138 | 137 | $params['api_key'] = $this->api_key; |
| 139 | - if (!is_null($query)) |
|
| 140 | - { |
|
| 138 | + if (!is_null($query)) { |
|
| 141 | 139 | $params['query'] = $query; |
| 142 | 140 | } |
| 143 | 141 | |
@@ -156,18 +154,15 @@ discard block |
||
| 156 | 154 | */ |
| 157 | 155 | public function getConfiguration() |
| 158 | 156 | { |
| 159 | - try |
|
| 160 | - { |
|
| 157 | + try { |
|
| 161 | 158 | $this->logger->debug('Start getting configuration'); |
| 162 | - if (is_null($this->configuration)) |
|
| 163 | - { |
|
| 159 | + if (is_null($this->configuration)) { |
|
| 164 | 160 | $this->logger->debug('No configuration found, sending HTTP request to get it'); |
| 165 | 161 | $this->configuration = $this->sendRequest(new HttpClient(new \GuzzleHttp\Client()), 'configuration'); |
| 166 | 162 | } |
| 167 | 163 | return $this->configuration; |
| 168 | 164 | } |
| 169 | - catch (TmdbException $ex) |
|
| 170 | - { |
|
| 165 | + catch (TmdbException $ex) { |
|
| 171 | 166 | throw $ex; |
| 172 | 167 | } |
| 173 | 168 | } |
@@ -186,10 +181,8 @@ discard block |
||
| 186 | 181 | $params['include_adult'] = $this->include_adult; |
| 187 | 182 | $params['page'] = $this->page; |
| 188 | 183 | // Check options |
| 189 | - foreach ($options as $key => $value) |
|
| 190 | - { |
|
| 191 | - switch ($key) |
|
| 192 | - { |
|
| 184 | + foreach ($options as $key => $value) { |
|
| 185 | + switch ($key) { |
|
| 193 | 186 | case 'year': |
| 194 | 187 | $params[$key] = $this->checkYear($value); |
| 195 | 188 | break; |
@@ -231,8 +224,7 @@ discard block |
||
| 231 | 224 | private function checkLanguage($language) |
| 232 | 225 | { |
| 233 | 226 | $check = preg_match("#([a-z]{2})-([A-Z]{2})#", $language); |
| 234 | - if ($check === 0 || $check === false) |
|
| 235 | - { |
|
| 227 | + if ($check === 0 || $check === false) { |
|
| 236 | 228 | $this->logger->error('Incorrect language param option', array('language' => $language)); |
| 237 | 229 | throw new IncorrectParamException; |
| 238 | 230 | } |
@@ -64,10 +64,8 @@ |
||
| 64 | 64 | |
| 65 | 65 | // Valid input object |
| 66 | 66 | $properties = get_object_vars($this); |
| 67 | - foreach (array_keys($properties) as $property) |
|
| 68 | - { |
|
| 69 | - if (!in_array($property, $this->property_blacklist) && !property_exists($result, $property)) |
|
| 70 | - { |
|
| 67 | + foreach (array_keys($properties) as $property) { |
|
| 68 | + if (!in_array($property, $this->property_blacklist) && !property_exists($result, $property)) { |
|
| 71 | 69 | throw new NotFoundException($property); |
| 72 | 70 | } |
| 73 | 71 | } |
@@ -67,8 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function __construct(TmdbInterface $tmdb, $item_id, array $options, $item_name) |
| 69 | 69 | { |
| 70 | - try |
|
| 71 | - { |
|
| 70 | + try { |
|
| 72 | 71 | $this->id = (int) $item_id; |
| 73 | 72 | $this->tmdb = $tmdb; |
| 74 | 73 | $this->logger = $tmdb->getLogger(); |
@@ -76,8 +75,7 @@ discard block |
||
| 76 | 75 | $this->params = $this->tmdb->checkOptions($options); |
| 77 | 76 | $this->data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), $item_name . '/' . (int) $item_id, null, $this->params); |
| 78 | 77 | } |
| 79 | - catch (TmdbException $ex) |
|
| 80 | - { |
|
| 78 | + catch (TmdbException $ex) { |
|
| 81 | 79 | throw $ex; |
| 82 | 80 | } |
| 83 | 81 | } |
@@ -44,10 +44,8 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function getCrew() |
| 46 | 46 | { |
| 47 | - if (!empty($this->data->crew)) |
|
| 48 | - { |
|
| 49 | - foreach ($this->data->crew as $c) |
|
| 50 | - { |
|
| 47 | + if (!empty($this->data->crew)) { |
|
| 48 | + foreach ($this->data->crew as $c) { |
|
| 51 | 49 | $crew = new PeopleTVShowCrew($this->tmdb, $c); |
| 52 | 50 | yield $crew; |
| 53 | 51 | } |
@@ -60,10 +58,8 @@ discard block |
||
| 60 | 58 | */ |
| 61 | 59 | public function getCast() |
| 62 | 60 | { |
| 63 | - if (!empty($this->data->cast)) |
|
| 64 | - { |
|
| 65 | - foreach ($this->data->cast as $c) |
|
| 66 | - { |
|
| 61 | + if (!empty($this->data->cast)) { |
|
| 62 | + foreach ($this->data->cast as $c) { |
|
| 67 | 63 | $cast = new PeopleTVShowCast($this->tmdb, $c); |
| 68 | 64 | yield $cast; |
| 69 | 65 | } |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function getId() |
| 71 | 71 | { |
| 72 | - if (isset($this->data->id)) |
|
| 73 | - { |
|
| 72 | + if (isset($this->data->id)) { |
|
| 74 | 73 | return (int) $this->data->id; |
| 75 | 74 | } |
| 76 | 75 | return 0; |
@@ -82,8 +81,7 @@ discard block |
||
| 82 | 81 | */ |
| 83 | 82 | public function getAirDate() |
| 84 | 83 | { |
| 85 | - if (isset($this->data->air_date)) |
|
| 86 | - { |
|
| 84 | + if (isset($this->data->air_date)) { |
|
| 87 | 85 | return $this->data->air_date; |
| 88 | 86 | } |
| 89 | 87 | return ''; |
@@ -95,8 +93,7 @@ discard block |
||
| 95 | 93 | */ |
| 96 | 94 | public function getEpisodeNumber() |
| 97 | 95 | { |
| 98 | - if (isset($this->data->episode_number)) |
|
| 99 | - { |
|
| 96 | + if (isset($this->data->episode_number)) { |
|
| 100 | 97 | return $this->data->episode_number; |
| 101 | 98 | } |
| 102 | 99 | return 0; |
@@ -108,10 +105,8 @@ discard block |
||
| 108 | 105 | */ |
| 109 | 106 | public function getGuestStars() |
| 110 | 107 | { |
| 111 | - if (isset($this->data->guest_stars)) |
|
| 112 | - { |
|
| 113 | - foreach ($this->data->guest_stars as $gs) |
|
| 114 | - { |
|
| 108 | + if (isset($this->data->guest_stars)) { |
|
| 109 | + foreach ($this->data->guest_stars as $gs) { |
|
| 115 | 110 | $gs->gender = null; |
| 116 | 111 | $gs->cast_id = null; |
| 117 | 112 | |
@@ -127,8 +122,7 @@ discard block |
||
| 127 | 122 | */ |
| 128 | 123 | public function getName() |
| 129 | 124 | { |
| 130 | - if (isset($this->data->name)) |
|
| 131 | - { |
|
| 125 | + if (isset($this->data->name)) { |
|
| 132 | 126 | return $this->data->name; |
| 133 | 127 | } |
| 134 | 128 | return ''; |
@@ -140,8 +134,7 @@ discard block |
||
| 140 | 134 | */ |
| 141 | 135 | public function getNote() |
| 142 | 136 | { |
| 143 | - if (isset($this->data->vote_average)) |
|
| 144 | - { |
|
| 137 | + if (isset($this->data->vote_average)) { |
|
| 145 | 138 | return $this->data->vote_average; |
| 146 | 139 | } |
| 147 | 140 | return 0; |
@@ -153,8 +146,7 @@ discard block |
||
| 153 | 146 | */ |
| 154 | 147 | public function getNoteCount() |
| 155 | 148 | { |
| 156 | - if (isset($this->data->vote_count)) |
|
| 157 | - { |
|
| 149 | + if (isset($this->data->vote_count)) { |
|
| 158 | 150 | return (int) $this->data->vote_count; |
| 159 | 151 | } |
| 160 | 152 | return 0; |
@@ -166,8 +158,7 @@ discard block |
||
| 166 | 158 | */ |
| 167 | 159 | public function getOverview() |
| 168 | 160 | { |
| 169 | - if (isset($this->data->overview)) |
|
| 170 | - { |
|
| 161 | + if (isset($this->data->overview)) { |
|
| 171 | 162 | return $this->data->overview; |
| 172 | 163 | } |
| 173 | 164 | return ''; |
@@ -179,8 +170,7 @@ discard block |
||
| 179 | 170 | */ |
| 180 | 171 | public function getProductionCode() |
| 181 | 172 | { |
| 182 | - if (isset($this->data->production_code)) |
|
| 183 | - { |
|
| 173 | + if (isset($this->data->production_code)) { |
|
| 184 | 174 | return $this->data->production_code; |
| 185 | 175 | } |
| 186 | 176 | return ''; |
@@ -192,8 +182,7 @@ discard block |
||
| 192 | 182 | */ |
| 193 | 183 | public function getSeasonNumber() |
| 194 | 184 | { |
| 195 | - if (isset($this->data->season_number)) |
|
| 196 | - { |
|
| 185 | + if (isset($this->data->season_number)) { |
|
| 197 | 186 | return (int) $this->data->season_number; |
| 198 | 187 | } |
| 199 | 188 | return 0; |
@@ -205,8 +194,7 @@ discard block |
||
| 205 | 194 | */ |
| 206 | 195 | public function getStillPath() |
| 207 | 196 | { |
| 208 | - if (isset($this->data->still_path)) |
|
| 209 | - { |
|
| 197 | + if (isset($this->data->still_path)) { |
|
| 210 | 198 | return $this->data->still_path; |
| 211 | 199 | } |
| 212 | 200 | return ''; |
@@ -220,8 +208,7 @@ discard block |
||
| 220 | 208 | { |
| 221 | 209 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/seasons/' . $this->season_number . '/episode/' . $this->episode_number . '/images', null, $this->params); |
| 222 | 210 | |
| 223 | - foreach ($data->posters as $b) |
|
| 224 | - { |
|
| 211 | + foreach ($data->posters as $b) { |
|
| 225 | 212 | $image = new Image($this->tmdb, $this->id, $b); |
| 226 | 213 | yield $image; |
| 227 | 214 | } |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function getGenres() |
| 61 | 61 | { |
| 62 | - if (isset($this->data->genres)) |
|
| 63 | - { |
|
| 62 | + if (isset($this->data->genres)) { |
|
| 64 | 63 | return $this->data->genres; |
| 65 | 64 | } |
| 66 | 65 | return []; |
@@ -72,8 +71,7 @@ discard block |
||
| 72 | 71 | */ |
| 73 | 72 | public function getNote() |
| 74 | 73 | { |
| 75 | - if (isset($this->data->vote_average)) |
|
| 76 | - { |
|
| 74 | + if (isset($this->data->vote_average)) { |
|
| 77 | 75 | return $this->data->vote_average; |
| 78 | 76 | } |
| 79 | 77 | return 0; |
@@ -85,8 +83,7 @@ discard block |
||
| 85 | 83 | */ |
| 86 | 84 | public function getNumberEpisodes() |
| 87 | 85 | { |
| 88 | - if (isset($this->data->number_of_episodes)) |
|
| 89 | - { |
|
| 86 | + if (isset($this->data->number_of_episodes)) { |
|
| 90 | 87 | return $this->data->number_of_episodes; |
| 91 | 88 | } |
| 92 | 89 | return 0; |
@@ -98,8 +95,7 @@ discard block |
||
| 98 | 95 | */ |
| 99 | 96 | public function getNumberSeasons() |
| 100 | 97 | { |
| 101 | - if (isset($this->data->number_of_seasons)) |
|
| 102 | - { |
|
| 98 | + if (isset($this->data->number_of_seasons)) { |
|
| 103 | 99 | return $this->data->number_of_seasons; |
| 104 | 100 | } |
| 105 | 101 | return 0; |
@@ -111,8 +107,7 @@ discard block |
||
| 111 | 107 | */ |
| 112 | 108 | public function getOriginalTitle() |
| 113 | 109 | { |
| 114 | - if (isset($this->data->original_name)) |
|
| 115 | - { |
|
| 110 | + if (isset($this->data->original_name)) { |
|
| 116 | 111 | return $this->data->original_name; |
| 117 | 112 | } |
| 118 | 113 | return ''; |
@@ -124,8 +119,7 @@ discard block |
||
| 124 | 119 | */ |
| 125 | 120 | public function getOverview() |
| 126 | 121 | { |
| 127 | - if (isset($this->data->overview)) |
|
| 128 | - { |
|
| 122 | + if (isset($this->data->overview)) { |
|
| 129 | 123 | return $this->data->overview; |
| 130 | 124 | } |
| 131 | 125 | return ''; |
@@ -137,8 +131,7 @@ discard block |
||
| 137 | 131 | */ |
| 138 | 132 | public function getReleaseDate() |
| 139 | 133 | { |
| 140 | - if (isset($this->data->first_air_date)) |
|
| 141 | - { |
|
| 134 | + if (isset($this->data->first_air_date)) { |
|
| 142 | 135 | return $this->data->first_air_date; |
| 143 | 136 | } |
| 144 | 137 | return ''; |
@@ -150,8 +143,7 @@ discard block |
||
| 150 | 143 | */ |
| 151 | 144 | public function getStatus() |
| 152 | 145 | { |
| 153 | - if (isset($this->data->status)) |
|
| 154 | - { |
|
| 146 | + if (isset($this->data->status)) { |
|
| 155 | 147 | return $this->data->status; |
| 156 | 148 | } |
| 157 | 149 | return ''; |
@@ -163,8 +155,7 @@ discard block |
||
| 163 | 155 | */ |
| 164 | 156 | public function getTitle() |
| 165 | 157 | { |
| 166 | - if (isset($this->data->name)) |
|
| 167 | - { |
|
| 158 | + if (isset($this->data->name)) { |
|
| 168 | 159 | return $this->data->name; |
| 169 | 160 | } |
| 170 | 161 | return ''; |
@@ -176,10 +167,8 @@ discard block |
||
| 176 | 167 | */ |
| 177 | 168 | public function getSeasons() |
| 178 | 169 | { |
| 179 | - if (!empty($this->data->seasons)) |
|
| 180 | - { |
|
| 181 | - foreach ($this->data->seasons as $season) |
|
| 182 | - { |
|
| 170 | + if (!empty($this->data->seasons)) { |
|
| 171 | + foreach ($this->data->seasons as $season) { |
|
| 183 | 172 | $season = new \vfalies\tmdb\Results\TVSeason($this->tmdb, $season); |
| 184 | 173 | yield $season; |
| 185 | 174 | } |
@@ -192,10 +181,8 @@ discard block |
||
| 192 | 181 | */ |
| 193 | 182 | public function getNetworks() |
| 194 | 183 | { |
| 195 | - if (!empty($this->data->networks)) |
|
| 196 | - { |
|
| 197 | - foreach ($this->data->networks as $network) |
|
| 198 | - { |
|
| 184 | + if (!empty($this->data->networks)) { |
|
| 185 | + foreach ($this->data->networks as $network) { |
|
| 199 | 186 | $n = new \stdClass(); |
| 200 | 187 | $n->id = $network->id; |
| 201 | 188 | $n->name = $network->name; |
@@ -213,8 +200,7 @@ discard block |
||
| 213 | 200 | { |
| 214 | 201 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/images', null, $this->params); |
| 215 | 202 | |
| 216 | - foreach ($data->backdrops as $b) |
|
| 217 | - { |
|
| 203 | + foreach ($data->backdrops as $b) { |
|
| 218 | 204 | $image = new Image($this->tmdb, $this->id, $b); |
| 219 | 205 | yield $image; |
| 220 | 206 | } |
@@ -228,8 +214,7 @@ discard block |
||
| 228 | 214 | { |
| 229 | 215 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/images', null, $this->params); |
| 230 | 216 | |
| 231 | - foreach ($data->posters as $b) |
|
| 232 | - { |
|
| 217 | + foreach ($data->posters as $b) { |
|
| 233 | 218 | $image = new Image($this->tmdb, $this->id, $b); |
| 234 | 219 | yield $image; |
| 235 | 220 | } |
@@ -243,8 +228,7 @@ discard block |
||
| 243 | 228 | { |
| 244 | 229 | $similar = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/similar', null, $this->params); |
| 245 | 230 | |
| 246 | - foreach ($similar->results as $t) |
|
| 247 | - { |
|
| 231 | + foreach ($similar->results as $t) { |
|
| 248 | 232 | $tvshow = new ResultTVShow($this->tmdb, $t); |
| 249 | 233 | yield $tvshow; |
| 250 | 234 | } |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function getId() |
| 61 | 61 | { |
| 62 | - if (!empty($this->data->id)) |
|
| 63 | - { |
|
| 62 | + if (!empty($this->data->id)) { |
|
| 64 | 63 | return (int) $this->data->id; |
| 65 | 64 | } |
| 66 | 65 | return 0; |
@@ -72,8 +71,7 @@ discard block |
||
| 72 | 71 | */ |
| 73 | 72 | public function getAirDate() |
| 74 | 73 | { |
| 75 | - if (!empty($this->data->air_date)) |
|
| 76 | - { |
|
| 74 | + if (!empty($this->data->air_date)) { |
|
| 77 | 75 | return $this->data->air_date; |
| 78 | 76 | } |
| 79 | 77 | return ''; |
@@ -85,8 +83,7 @@ discard block |
||
| 85 | 83 | */ |
| 86 | 84 | public function getEpisodeCount() |
| 87 | 85 | { |
| 88 | - if (!empty($this->data->episodes)) |
|
| 89 | - { |
|
| 86 | + if (!empty($this->data->episodes)) { |
|
| 90 | 87 | return count($this->data->episodes); |
| 91 | 88 | } |
| 92 | 89 | return 0; |
@@ -98,8 +95,7 @@ discard block |
||
| 98 | 95 | */ |
| 99 | 96 | public function getSeasonNumber() |
| 100 | 97 | { |
| 101 | - if (!empty($this->data->season_number)) |
|
| 102 | - { |
|
| 98 | + if (!empty($this->data->season_number)) { |
|
| 103 | 99 | return (int) $this->data->season_number; |
| 104 | 100 | } |
| 105 | 101 | return 0; |
@@ -111,10 +107,8 @@ discard block |
||
| 111 | 107 | */ |
| 112 | 108 | public function getEpisodes() |
| 113 | 109 | { |
| 114 | - if (!empty($this->data->episodes)) |
|
| 115 | - { |
|
| 116 | - foreach ($this->data->episodes as $episode) |
|
| 117 | - { |
|
| 110 | + if (!empty($this->data->episodes)) { |
|
| 111 | + foreach ($this->data->episodes as $episode) { |
|
| 118 | 112 | $episode = new \vfalies\tmdb\Results\TVEpisode($this->tmdb, $episode); |
| 119 | 113 | yield $episode; |
| 120 | 114 | } |
@@ -127,8 +121,7 @@ discard block |
||
| 127 | 121 | */ |
| 128 | 122 | public function getName() |
| 129 | 123 | { |
| 130 | - if (!empty($this->data->name)) |
|
| 131 | - { |
|
| 124 | + if (!empty($this->data->name)) { |
|
| 132 | 125 | return $this->data->name; |
| 133 | 126 | } |
| 134 | 127 | return ''; |
@@ -140,8 +133,7 @@ discard block |
||
| 140 | 133 | */ |
| 141 | 134 | public function getOverview() |
| 142 | 135 | { |
| 143 | - if (!empty($this->data->overview)) |
|
| 144 | - { |
|
| 136 | + if (!empty($this->data->overview)) { |
|
| 145 | 137 | return $this->data->overview; |
| 146 | 138 | } |
| 147 | 139 | return ''; |
@@ -155,8 +147,7 @@ discard block |
||
| 155 | 147 | { |
| 156 | 148 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/seasons/' . $this->season_number . '/images', null, $this->params); |
| 157 | 149 | |
| 158 | - foreach ($data->posters as $b) |
|
| 159 | - { |
|
| 150 | + foreach ($data->posters as $b) { |
|
| 160 | 151 | $image = new Image($this->tmdb, $this->id, $b); |
| 161 | 152 | yield $image; |
| 162 | 153 | } |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getGenres() |
| 53 | 53 | { |
| 54 | - if (isset($this->data->genres)) |
|
| 55 | - { |
|
| 54 | + if (isset($this->data->genres)) { |
|
| 56 | 55 | return $this->data->genres; |
| 57 | 56 | } |
| 58 | 57 | return []; |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | */ |
| 65 | 64 | public function getTitle() |
| 66 | 65 | { |
| 67 | - if (isset($this->data->title)) |
|
| 68 | - { |
|
| 66 | + if (isset($this->data->title)) { |
|
| 69 | 67 | return $this->data->title; |
| 70 | 68 | } |
| 71 | 69 | return ''; |
@@ -77,8 +75,7 @@ discard block |
||
| 77 | 75 | */ |
| 78 | 76 | public function getOverview() |
| 79 | 77 | { |
| 80 | - if (isset($this->data->overview)) |
|
| 81 | - { |
|
| 78 | + if (isset($this->data->overview)) { |
|
| 82 | 79 | return $this->data->overview; |
| 83 | 80 | } |
| 84 | 81 | return ''; |
@@ -90,8 +87,7 @@ discard block |
||
| 90 | 87 | */ |
| 91 | 88 | public function getReleaseDate() |
| 92 | 89 | { |
| 93 | - if (isset($this->data->release_date)) |
|
| 94 | - { |
|
| 90 | + if (isset($this->data->release_date)) { |
|
| 95 | 91 | return $this->data->release_date; |
| 96 | 92 | } |
| 97 | 93 | return ''; |
@@ -103,8 +99,7 @@ discard block |
||
| 103 | 99 | */ |
| 104 | 100 | public function getOriginalTitle() |
| 105 | 101 | { |
| 106 | - if (isset($this->data->original_title)) |
|
| 107 | - { |
|
| 102 | + if (isset($this->data->original_title)) { |
|
| 108 | 103 | return $this->data->original_title; |
| 109 | 104 | } |
| 110 | 105 | return ''; |
@@ -116,8 +111,7 @@ discard block |
||
| 116 | 111 | */ |
| 117 | 112 | public function getNote() |
| 118 | 113 | { |
| 119 | - if (isset($this->data->vote_average)) |
|
| 120 | - { |
|
| 114 | + if (isset($this->data->vote_average)) { |
|
| 121 | 115 | return $this->data->vote_average; |
| 122 | 116 | } |
| 123 | 117 | return 0; |
@@ -138,8 +132,7 @@ discard block |
||
| 138 | 132 | */ |
| 139 | 133 | public function getIMDBId() |
| 140 | 134 | { |
| 141 | - if (isset($this->data->imdb_id)) |
|
| 142 | - { |
|
| 135 | + if (isset($this->data->imdb_id)) { |
|
| 143 | 136 | return $this->data->imdb_id; |
| 144 | 137 | } |
| 145 | 138 | return ''; |
@@ -151,8 +144,7 @@ discard block |
||
| 151 | 144 | */ |
| 152 | 145 | public function getTagLine() |
| 153 | 146 | { |
| 154 | - if (isset($this->data->tagline)) |
|
| 155 | - { |
|
| 147 | + if (isset($this->data->tagline)) { |
|
| 156 | 148 | return $this->data->tagline; |
| 157 | 149 | } |
| 158 | 150 | return ''; |
@@ -164,8 +156,7 @@ discard block |
||
| 164 | 156 | */ |
| 165 | 157 | public function getCollectionId() |
| 166 | 158 | { |
| 167 | - if (!empty($this->data->belongs_to_collection)) |
|
| 168 | - { |
|
| 159 | + if (!empty($this->data->belongs_to_collection)) { |
|
| 169 | 160 | return (int) $this->data->belongs_to_collection->id; |
| 170 | 161 | } |
| 171 | 162 | return 0; |
@@ -197,10 +188,8 @@ discard block |
||
| 197 | 188 | */ |
| 198 | 189 | public function getProductionCompanies() |
| 199 | 190 | { |
| 200 | - if (!empty($this->data->production_companies)) |
|
| 201 | - { |
|
| 202 | - foreach ($this->data->production_companies as $p) |
|
| 203 | - { |
|
| 191 | + if (!empty($this->data->production_companies)) { |
|
| 192 | + foreach ($this->data->production_companies as $p) { |
|
| 204 | 193 | $res = new \stdClass(); |
| 205 | 194 | $res->id = $p->id; |
| 206 | 195 | $res->name = $p->name; |
@@ -216,10 +205,8 @@ discard block |
||
| 216 | 205 | */ |
| 217 | 206 | public function getProductionCountries() |
| 218 | 207 | { |
| 219 | - if (!empty($this->data->production_countries)) |
|
| 220 | - { |
|
| 221 | - foreach ($this->data->production_countries as $c) |
|
| 222 | - { |
|
| 208 | + if (!empty($this->data->production_countries)) { |
|
| 209 | + foreach ($this->data->production_countries as $c) { |
|
| 223 | 210 | $res = new \stdClass(); |
| 224 | 211 | $res->iso_3166_1 = $c->iso_3166_1; |
| 225 | 212 | $res->name = $c->name; |
@@ -237,8 +224,7 @@ discard block |
||
| 237 | 224 | { |
| 238 | 225 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/images', null, $this->params); |
| 239 | 226 | |
| 240 | - foreach ($data->backdrops as $b) |
|
| 241 | - { |
|
| 227 | + foreach ($data->backdrops as $b) { |
|
| 242 | 228 | $image = new Image($this->tmdb, $this->id, $b); |
| 243 | 229 | yield $image; |
| 244 | 230 | } |
@@ -252,8 +238,7 @@ discard block |
||
| 252 | 238 | { |
| 253 | 239 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/images', null, $this->params); |
| 254 | 240 | |
| 255 | - foreach ($data->posters as $b) |
|
| 256 | - { |
|
| 241 | + foreach ($data->posters as $b) { |
|
| 257 | 242 | $image = new Image($this->tmdb, $this->id, $b); |
| 258 | 243 | yield $image; |
| 259 | 244 | } |
@@ -267,8 +252,7 @@ discard block |
||
| 267 | 252 | { |
| 268 | 253 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/similar', null, $this->params); |
| 269 | 254 | |
| 270 | - foreach ($data->results as $s) |
|
| 271 | - { |
|
| 255 | + foreach ($data->results as $s) { |
|
| 272 | 256 | $movie = new ResultMovie($this->tmdb, $s); |
| 273 | 257 | yield $movie; |
| 274 | 258 | } |
@@ -76,8 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function getName() |
| 78 | 78 | { |
| 79 | - if (isset($this->data->name)) |
|
| 80 | - { |
|
| 79 | + if (isset($this->data->name)) { |
|
| 81 | 80 | return $this->data->name; |
| 82 | 81 | } |
| 83 | 82 | $this->logger->error('Collection name not found', array('collection_id' => $this->id)); |
@@ -90,10 +89,8 @@ discard block |
||
| 90 | 89 | */ |
| 91 | 90 | public function getParts() |
| 92 | 91 | { |
| 93 | - if (!empty($this->data->parts)) |
|
| 94 | - { |
|
| 95 | - foreach ($this->data->parts as $part) |
|
| 96 | - { |
|
| 92 | + if (!empty($this->data->parts)) { |
|
| 93 | + foreach ($this->data->parts as $part) { |
|
| 97 | 94 | $movie = new \vfalies\tmdb\Results\Movie($this->tmdb, $part); |
| 98 | 95 | yield $movie; |
| 99 | 96 | } |
@@ -108,8 +105,7 @@ discard block |
||
| 108 | 105 | { |
| 109 | 106 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/collection/' . (int) $this->id . '/images', null, $this->params); |
| 110 | 107 | |
| 111 | - foreach ($data->backdrops as $b) |
|
| 112 | - { |
|
| 108 | + foreach ($data->backdrops as $b) { |
|
| 113 | 109 | $image = new Image($this->tmdb, $this->id, $b); |
| 114 | 110 | yield $image; |
| 115 | 111 | } |
@@ -123,8 +119,7 @@ discard block |
||
| 123 | 119 | { |
| 124 | 120 | $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/collection/' . (int) $this->id . '/images', null, $this->params); |
| 125 | 121 | |
| 126 | - foreach ($data->posters as $b) |
|
| 127 | - { |
|
| 122 | + foreach ($data->posters as $b) { |
|
| 128 | 123 | $image = new Image($this->tmdb, $this->id, $b); |
| 129 | 124 | yield $image; |
| 130 | 125 | } |