@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct(TmdbInterface $tmdb, $people_id, array $options = array()) |
| 38 | 38 | { |
| 39 | - parent::__construct($tmdb, '/movie_credits', $options, 'person/'.$people_id); |
|
| 39 | + parent::__construct($tmdb, '/movie_credits', $options, 'person/' . $people_id); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function getCollectionId() |
| 167 | 167 | { |
| 168 | - if ( ! empty($this->data->belongs_to_collection)) |
|
| 168 | + if (!empty($this->data->belongs_to_collection)) |
|
| 169 | 169 | { |
| 170 | 170 | return (int) $this->data->belongs_to_collection->id; |
| 171 | 171 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | public function getProductionCompanies() |
| 200 | 200 | { |
| 201 | - if ( ! empty($this->data->production_companies)) |
|
| 201 | + if (!empty($this->data->production_companies)) |
|
| 202 | 202 | { |
| 203 | 203 | foreach ($this->data->production_companies as $p) |
| 204 | 204 | { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function getProductionCountries() |
| 219 | 219 | { |
| 220 | - if ( ! empty($this->data->production_countries)) |
|
| 220 | + if (!empty($this->data->production_countries)) |
|
| 221 | 221 | { |
| 222 | 222 | foreach ($this->data->production_countries as $c) |
| 223 | 223 | { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function getBackdrops() |
| 238 | 238 | { |
| 239 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/'.(int) $this->id.'/images', null, $this->params); |
|
| 239 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/images', null, $this->params); |
|
| 240 | 240 | |
| 241 | 241 | foreach ($data->backdrops as $b) |
| 242 | 242 | { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function getPosters() |
| 253 | 253 | { |
| 254 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/'.(int) $this->id.'/images', null, $this->params); |
|
| 254 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/images', null, $this->params); |
|
| 255 | 255 | |
| 256 | 256 | foreach ($data->posters as $b) |
| 257 | 257 | { |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | */ |
| 267 | 267 | public function getSimilar() |
| 268 | 268 | { |
| 269 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/'.(int) $this->id.'/similar', null, $this->params); |
|
| 269 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/movie/' . (int) $this->id . '/similar', null, $this->params); |
|
| 270 | 270 | |
| 271 | 271 | foreach ($data->results as $s) |
| 272 | 272 | { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function __construct(TmdbInterface $tmdb, $tv_id, $season_number, array $options = array()) |
| 51 | 51 | { |
| 52 | - parent::__construct($tmdb, $season_number, $options, 'tv/'.$tv_id); |
|
| 52 | + parent::__construct($tmdb, $season_number, $options, 'tv/' . $tv_id); |
|
| 53 | 53 | |
| 54 | 54 | $this->season_number = $season_number; |
| 55 | 55 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function getId() |
| 62 | 62 | { |
| 63 | - if ( ! empty($this->data->id)) |
|
| 63 | + if (!empty($this->data->id)) |
|
| 64 | 64 | { |
| 65 | 65 | return (int) $this->data->id; |
| 66 | 66 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function getAirDate() |
| 75 | 75 | { |
| 76 | - if ( ! empty($this->data->air_date)) |
|
| 76 | + if (!empty($this->data->air_date)) |
|
| 77 | 77 | { |
| 78 | 78 | return $this->data->air_date; |
| 79 | 79 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function getEpisodeCount() |
| 88 | 88 | { |
| 89 | - if ( ! empty($this->data->episodes)) |
|
| 89 | + if (!empty($this->data->episodes)) |
|
| 90 | 90 | { |
| 91 | 91 | return count($this->data->episodes); |
| 92 | 92 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function getSeasonNumber() |
| 101 | 101 | { |
| 102 | - if ( ! empty($this->data->season_number)) |
|
| 102 | + if (!empty($this->data->season_number)) |
|
| 103 | 103 | { |
| 104 | 104 | return (int) $this->data->season_number; |
| 105 | 105 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function getEpisodes() |
| 114 | 114 | { |
| 115 | - if ( ! empty($this->data->episodes)) |
|
| 115 | + if (!empty($this->data->episodes)) |
|
| 116 | 116 | { |
| 117 | 117 | foreach ($this->data->episodes as $episode) |
| 118 | 118 | { |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function getName() |
| 130 | 130 | { |
| 131 | - if ( ! empty($this->data->name)) |
|
| 131 | + if (!empty($this->data->name)) |
|
| 132 | 132 | { |
| 133 | 133 | return $this->data->name; |
| 134 | 134 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function getOverview() |
| 143 | 143 | { |
| 144 | - if ( ! empty($this->data->overview)) |
|
| 144 | + if (!empty($this->data->overview)) |
|
| 145 | 145 | { |
| 146 | 146 | return $this->data->overview; |
| 147 | 147 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function getPosters() |
| 156 | 156 | { |
| 157 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/seasons/'.$this->season_number.'/images', null, $this->params); |
|
| 157 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/seasons/' . $this->season_number . '/images', null, $this->params); |
|
| 158 | 158 | |
| 159 | 159 | foreach ($data->posters as $b) |
| 160 | 160 | { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function getNetworks() |
| 184 | 184 | { |
| 185 | - if ( ! empty($this->data->networks)) |
|
| 185 | + if (!empty($this->data->networks)) |
|
| 186 | 186 | { |
| 187 | 187 | foreach ($this->data->networks as $network) |
| 188 | 188 | { |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function getBackdrops() |
| 203 | 203 | { |
| 204 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/images', null, $this->params); |
|
| 204 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/images', null, $this->params); |
|
| 205 | 205 | |
| 206 | 206 | foreach ($data->backdrops as $b) |
| 207 | 207 | { |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function getPosters() |
| 218 | 218 | { |
| 219 | - $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/images', null, $this->params); |
|
| 219 | + $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/images', null, $this->params); |
|
| 220 | 220 | |
| 221 | 221 | foreach ($data->posters as $b) |
| 222 | 222 | { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function getSimilar() |
| 233 | 233 | { |
| 234 | - $similar = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/'.(int) $this->id.'/similar', null, $this->params); |
|
| 234 | + $similar = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/tv/' . (int) $this->id . '/similar', null, $this->params); |
|
| 235 | 235 | |
| 236 | 236 | foreach ($similar->results as $t) |
| 237 | 237 | { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function extractConfig(array $builderConfig) |
| 93 | 93 | { |
| 94 | - return isset($builderConfig['config']) ? $builderConfig['config']:[]; |
|
| 94 | + return isset($builderConfig['config']) ? $builderConfig['config'] : []; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function checkDependency(BuilderInterface $builder) |
| 104 | 104 | { |
| 105 | - if (! class_exists($builder->getMainClassName())) { |
|
| 105 | + if (!class_exists($builder->getMainClassName())) { |
|
| 106 | 106 | $message = "missing {$builder->getPackageName()}, please install it using composer : composer require {$builder->getPackageName()}"; |
| 107 | 107 | throw new MissingDependencyException($message); |
| 108 | 108 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * Create |
| 38 | 38 | * @param array $loggerConf |
| 39 | - * @return \static |
|
| 39 | + * @return Factory |
|
| 40 | 40 | */ |
| 41 | 41 | public static function create($loggerConf = ['builder' => 'NullLogger', 'config' => []]) |
| 42 | 42 | { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * Get Tmdb object |
| 51 | 51 | * @param string $api_key API Key |
| 52 | 52 | * @param int $version API Version (not yet used) |
| 53 | - * @return TmdbInterface |
|
| 53 | + * @return Tmdb |
|
| 54 | 54 | */ |
| 55 | 55 | public function getTmdb($api_key, $version = 3) |
| 56 | 56 | { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * Get Builder |
| 62 | 62 | * @param string $builder |
| 63 | 63 | * @param array $args |
| 64 | - * @return type |
|
| 64 | + * @return LoggerBuilderInterface |
|
| 65 | 65 | */ |
| 66 | 66 | public function getBuilder($builder, array $args = []) |
| 67 | 67 | { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function getCrew() |
| 31 | 31 | { |
| 32 | - if ( ! empty($this->data->crew)) |
|
| 32 | + if (!empty($this->data->crew)) |
|
| 33 | 33 | { |
| 34 | 34 | foreach ($this->data->crew as $crew) |
| 35 | 35 | { |
@@ -7,7 +7,6 @@ discard block |
||
| 7 | 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | * |
| 10 | - |
|
| 11 | 10 | * @author Vincent Faliès <[email protected]> |
| 12 | 11 | * @copyright Copyright (c) 2017 |
| 13 | 12 | */ |
@@ -49,10 +48,10 @@ discard block |
||
| 49 | 48 | */ |
| 50 | 49 | protected $title; |
| 51 | 50 | |
| 52 | - /** |
|
| 53 | - * Get show ID |
|
| 54 | - * @return int |
|
| 55 | - */ |
|
| 51 | + /** |
|
| 52 | + * Get show ID |
|
| 53 | + * @return int |
|
| 54 | + */ |
|
| 56 | 55 | public function getId() |
| 57 | 56 | { |
| 58 | 57 | return (int) $this->id; |
@@ -92,8 +92,7 @@ discard block |
||
| 92 | 92 | $this->total_results = (int) $response->total_results; |
| 93 | 93 | |
| 94 | 94 | return $this->searchItemGenerator($response->results, $result_class); |
| 95 | - } |
|
| 96 | - catch (TmdbException $ex) |
|
| 95 | + } catch (TmdbException $ex) |
|
| 97 | 96 | { |
| 98 | 97 | throw $ex; |
| 99 | 98 | } |
@@ -182,8 +181,7 @@ discard block |
||
| 182 | 181 | { |
| 183 | 182 | $this->logger->debug('Starting search people'); |
| 184 | 183 | return $this->searchItem('people', $query, $options, Results\People::class); |
| 185 | - } |
|
| 186 | - catch (TmdbException $ex) |
|
| 184 | + } catch (TmdbException $ex) |
|
| 187 | 185 | { |
| 188 | 186 | throw $ex; |
| 189 | 187 | } |
@@ -202,8 +200,7 @@ discard block |
||
| 202 | 200 | { |
| 203 | 201 | $this->logger->debug('Starting search company'); |
| 204 | 202 | return $this->searchItem('people', $query, $options, Results\Company::class); |
| 205 | - } |
|
| 206 | - catch (TmdbException $ex) |
|
| 203 | + } catch (TmdbException $ex) |
|
| 207 | 204 | { |
| 208 | 205 | throw $ex; |
| 209 | 206 | } |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |
@@ -32,22 +32,22 @@ discard block |
||
| 32 | 32 | * Tmdb object |
| 33 | 33 | * @var TmdbInterface |
| 34 | 34 | */ |
| 35 | - private $tmdb = null; |
|
| 35 | + private $tmdb = null; |
|
| 36 | 36 | /** |
| 37 | 37 | * Logger |
| 38 | 38 | * @var LoggerInterface |
| 39 | 39 | */ |
| 40 | - private $logger = null; |
|
| 40 | + private $logger = null; |
|
| 41 | 41 | /** |
| 42 | 42 | * Page number of the search result |
| 43 | 43 | * @var int |
| 44 | 44 | */ |
| 45 | - private $page = 1; |
|
| 45 | + private $page = 1; |
|
| 46 | 46 | /** |
| 47 | 47 | * Total pages of the search result |
| 48 | 48 | * @var int |
| 49 | 49 | */ |
| 50 | - private $total_pages = 1; |
|
| 50 | + private $total_pages = 1; |
|
| 51 | 51 | /** |
| 52 | 52 | * Total results of the search result |
| 53 | 53 | * @var int |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | throw new IncorrectParamException; |
| 86 | 86 | } |
| 87 | 87 | $params = $this->tmdb->checkOptions($options); |
| 88 | - $response = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), 'search/'.$item, $query, $params); |
|
| 88 | + $response = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), 'search/' . $item, $query, $params); |
|
| 89 | 89 | |
| 90 | 90 | $this->page = (int) $response->page; |
| 91 | 91 | $this->total_pages = (int) $response->total_pages; |
@@ -32,22 +32,22 @@ discard block |
||
| 32 | 32 | * Adult |
| 33 | 33 | * @var string |
| 34 | 34 | */ |
| 35 | - protected $adult = null; |
|
| 35 | + protected $adult = null; |
|
| 36 | 36 | /** |
| 37 | 37 | * People known for |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - protected $known_for = null; |
|
| 40 | + protected $known_for = null; |
|
| 41 | 41 | /** |
| 42 | 42 | * People name |
| 43 | 43 | * @var string |
| 44 | 44 | */ |
| 45 | - protected $name = null; |
|
| 45 | + protected $name = null; |
|
| 46 | 46 | /** |
| 47 | 47 | * Popularity |
| 48 | 48 | * @var int |
| 49 | 49 | */ |
| 50 | - protected $popularity = null; |
|
| 50 | + protected $popularity = null; |
|
| 51 | 51 | /** |
| 52 | 52 | * Image profile path |
| 53 | 53 | * @var string |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Id |
| 58 | 58 | * @var int |
| 59 | 59 | */ |
| 60 | - protected $id = null; |
|
| 60 | + protected $id = null; |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Constructor |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | * |
| 11 | - |
|
| 12 | 11 | * @author Vincent Faliès <[email protected]> |
| 13 | 12 | * @copyright Copyright (c) 2017 |
| 14 | 13 | */ |