@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use vfalies\tmdb\Tmdb; |
| 6 | 6 | use vfalies\tmdb\lib\Guzzle\Client as HttpClient; |
| 7 | 7 | use vfalies\tmdb\Exceptions\TmdbException; |
| 8 | -use vfalies\tmdb\Traits\ElementTrait; |
|
| 9 | 8 | |
| 10 | 9 | abstract class Item |
| 11 | 10 | { |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * Get collection parts |
| 61 | - * @return Generator |
|
| 61 | + * @return \Generator |
|
| 62 | 62 | */ |
| 63 | 63 | public function getParts() |
| 64 | 64 | { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function getBackdrops() |
| 74 | 74 | { |
| 75 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/collection/'.(int) $this->id.'/images', null, $this->params); |
|
| 75 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/collection/' . (int) $this->id . '/images', null, $this->params); |
|
| 76 | 76 | |
| 77 | 77 | foreach ($data->backdrops as $b) |
| 78 | 78 | { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | public function getPosters() |
| 85 | 85 | { |
| 86 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/collection/'.(int) $this->id.'/images', null, $this->params); |
|
| 86 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/collection/' . (int) $this->id . '/images', null, $this->params); |
|
| 87 | 87 | |
| 88 | 88 | foreach ($data->posters as $b) |
| 89 | 89 | { |
@@ -15,6 +15,9 @@ |
||
| 15 | 15 | |
| 16 | 16 | use ElementTrait; |
| 17 | 17 | |
| 18 | + /** |
|
| 19 | + * @param integer $tv_id |
|
| 20 | + */ |
|
| 18 | 21 | public function __construct(Tmdb $tmdb, $tv_id, array $options = array()) |
| 19 | 22 | { |
| 20 | 23 | parent::__construct($tmdb, $tv_id, $options, 'tv'); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | public function getBackdrops() |
| 156 | 156 | { |
| 157 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/images', null, $this->params); |
|
| 157 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/images', null, $this->params); |
|
| 158 | 158 | |
| 159 | 159 | foreach ($data->backdrops as $b) |
| 160 | 160 | { |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | public function getPosters() |
| 167 | 167 | { |
| 168 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/images', null, $this->params); |
|
| 168 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/images', null, $this->params); |
|
| 169 | 169 | |
| 170 | 170 | foreach ($data->posters as $b) |
| 171 | 171 | { |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function __construct(Tmdb $tmdb, $tv_id, $season_number, array $options = array()) |
| 29 | 29 | { |
| 30 | - parent::__construct($tmdb, $season_number, $options, 'tv/'.$tv_id); |
|
| 30 | + parent::__construct($tmdb, $season_number, $options, 'tv/' . $tv_id); |
|
| 31 | 31 | |
| 32 | 32 | $this->season_number = $season_number; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function getId() |
| 36 | 36 | { |
| 37 | - if ( ! empty($this->data->id)) |
|
| 37 | + if (!empty($this->data->id)) |
|
| 38 | 38 | { |
| 39 | 39 | return (int) $this->data->id; |
| 40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function getAirDate() |
| 45 | 45 | { |
| 46 | - if ( ! empty($this->data->air_date)) |
|
| 46 | + if (!empty($this->data->air_date)) |
|
| 47 | 47 | { |
| 48 | 48 | return $this->data->air_date; |
| 49 | 49 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function getEpisodeCount() |
| 54 | 54 | { |
| 55 | - if ( ! empty($this->data->episodes)) |
|
| 55 | + if (!empty($this->data->episodes)) |
|
| 56 | 56 | { |
| 57 | 57 | return count($this->data->episodes); |
| 58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function getSeasonNumber() |
| 63 | 63 | { |
| 64 | - if ( ! empty($this->data->season_number)) |
|
| 64 | + if (!empty($this->data->season_number)) |
|
| 65 | 65 | { |
| 66 | 66 | return (int) $this->data->season_number; |
| 67 | 67 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public function getEpisodes() |
| 72 | 72 | { |
| 73 | - if ( ! empty($this->data->episodes)) |
|
| 73 | + if (!empty($this->data->episodes)) |
|
| 74 | 74 | { |
| 75 | 75 | foreach ($this->data->episodes as $episode) |
| 76 | 76 | { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function getName() |
| 84 | 84 | { |
| 85 | - if ( ! empty($this->data->name)) |
|
| 85 | + if (!empty($this->data->name)) |
|
| 86 | 86 | { |
| 87 | 87 | return $this->data->name; |
| 88 | 88 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function getOverview() |
| 93 | 93 | { |
| 94 | - if ( ! empty($this->data->overview)) |
|
| 94 | + if (!empty($this->data->overview)) |
|
| 95 | 95 | { |
| 96 | 96 | return $this->data->overview; |
| 97 | 97 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | public function getPosters() |
| 102 | 102 | { |
| 103 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/seasons/'.$this->season_number.'/images', null, $this->params); |
|
| 103 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/seasons/' . $this->season_number . '/images', null, $this->params); |
|
| 104 | 104 | |
| 105 | 105 | foreach ($data->posters as $b) |
| 106 | 106 | { |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | |
| 146 | 146 | public function getProfiles() |
| 147 | 147 | { |
| 148 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/person/'.(int) $this->id.'/images', null, $this->params); |
|
| 148 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/person/' . (int) $this->id . '/images', null, $this->params); |
|
| 149 | 149 | |
| 150 | 150 | foreach ($data->profiles as $b) |
| 151 | 151 | { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function getCollectionId() |
| 149 | 149 | { |
| 150 | - if ( ! empty($this->data->belongs_to_collection)) |
|
| 150 | + if (!empty($this->data->belongs_to_collection)) |
|
| 151 | 151 | { |
| 152 | 152 | return (int) $this->data->belongs_to_collection->id; |
| 153 | 153 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | public function getProductionCompanies() |
| 178 | 178 | { |
| 179 | - if ( ! empty($this->data->production_companies)) |
|
| 179 | + if (!empty($this->data->production_companies)) |
|
| 180 | 180 | { |
| 181 | 181 | foreach ($this->data->production_companies as $p) |
| 182 | 182 | { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | public function getProductionCountries() |
| 193 | 193 | { |
| 194 | - if ( ! empty($this->data->production_countries)) |
|
| 194 | + if (!empty($this->data->production_countries)) |
|
| 195 | 195 | { |
| 196 | 196 | foreach ($this->data->production_countries as $c) |
| 197 | 197 | { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | public function getBackdrops() |
| 208 | 208 | { |
| 209 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/'.(int) $this->id.'/images', null, $this->params); |
|
| 209 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/images', null, $this->params); |
|
| 210 | 210 | |
| 211 | 211 | foreach ($data->backdrops as $b) |
| 212 | 212 | { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | public function getPosters() |
| 219 | 219 | { |
| 220 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/'.(int) $this->id.'/images', null, $this->params); |
|
| 220 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/images', null, $this->params); |
|
| 221 | 221 | |
| 222 | 222 | foreach ($data->posters as $b) |
| 223 | 223 | { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function __construct(Tmdb $tmdb, $tv_id, $season_number, $episode_number, array $options = array()) |
| 23 | 23 | { |
| 24 | - parent::__construct($tmdb, $episode_number, $options, 'tv/'.$tv_id.'/'.$season_number); |
|
| 24 | + parent::__construct($tmdb, $episode_number, $options, 'tv/' . $tv_id . '/' . $season_number); |
|
| 25 | 25 | |
| 26 | 26 | $this->season_number = $season_number; |
| 27 | 27 | $this->episode_number = $episode_number; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function getCrew() |
| 53 | 53 | { |
| 54 | - if ( ! empty($this->data->crew)) |
|
| 54 | + if (!empty($this->data->crew)) |
|
| 55 | 55 | { |
| 56 | 56 | foreach ($this->data->crew as $crew) |
| 57 | 57 | { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | public function getPosters() |
| 148 | 148 | { |
| 149 | - $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); |
|
| 149 | + $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); |
|
| 150 | 150 | |
| 151 | 151 | foreach ($data->posters as $b) |
| 152 | 152 | { |