@@ -58,7 +58,7 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function __construct(TmdbInterface $tmdb, int $tv_id, int $season_number, int $episode_number, array $options = array()) |
| 60 | 60 | { |
| 61 | - parent::__construct($tmdb, $episode_number, $options, 'tv/' . $tv_id . '/season/' . $season_number.'/episode'); |
|
| 61 | + parent::__construct($tmdb, $episode_number, $options, 'tv/' . $tv_id . '/season/' . $season_number . '/episode'); |
|
| 62 | 62 | |
| 63 | 63 | $this->season_number = $season_number; |
| 64 | 64 | $this->episode_number = $episode_number; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public function getBuilder(string $builder, array $args = []) : LoggerBuilderInterface |
| 67 | 67 | { |
| 68 | - $class = "\\VfacTmdb\\Factory\\Builder\\{$builder}Builder"; |
|
| 68 | + $class = "\\VfacTmdb\\Factory\\Builder\\{$builder}builder"; |
|
| 69 | 69 | |
| 70 | 70 | $reflection = new \ReflectionClass($class); |
| 71 | 71 | |
@@ -121,11 +121,11 @@ |
||
| 121 | 121 | public function __get(string $name) |
| 122 | 122 | { |
| 123 | 123 | switch ($name) { |
| 124 | - case 'request_token': |
|
| 124 | + case 'request_token': |
|
| 125 | 125 | case 'session_id': |
| 126 | 126 | return $this->$name; |
| 127 | - default: |
|
| 127 | + default: |
|
| 128 | 128 | throw new NotFoundException(); |
| 129 | - } |
|
| 129 | + } |
|
| 130 | 130 | } |
| 131 | 131 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * Session Id |
| 48 | 48 | * @var string |
| 49 | 49 | */ |
| 50 | - private $session_id = null; |
|
| 50 | + private $session_id = null; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Constructor |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | if (!isset($data->success) || $data->success != 'true' || !isset($data->request_token)) { |
| 90 | 90 | throw new InvalidResponseException("Getting request token failed"); |
| 91 | 91 | } |
| 92 | - $this->request_token = $data->request_token; |
|
| 92 | + $this->request_token = $data->request_token; |
|
| 93 | 93 | |
| 94 | 94 | return $this->request_token; |
| 95 | 95 | } |
@@ -156,7 +156,8 @@ discard block |
||
| 156 | 156 | $this->tmdb->postRequest($action, $this->options, $params); |
| 157 | 157 | |
| 158 | 158 | return $this; |
| 159 | - } catch (TmdbException $e) { |
|
| 159 | + } |
|
| 160 | + catch (TmdbException $e) { |
|
| 160 | 161 | throw $e; |
| 161 | 162 | } |
| 162 | 163 | } |
@@ -172,7 +173,8 @@ discard block |
||
| 172 | 173 | $this->tmdb->deleteRequest($action, $this->options); |
| 173 | 174 | |
| 174 | 175 | return $this; |
| 175 | - } catch (TmdbException $e) { |
|
| 176 | + } |
|
| 177 | + catch (TmdbException $e) { |
|
| 176 | 178 | throw $e; |
| 177 | 179 | } |
| 178 | 180 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function addMovieRate(int $movie_id, float $rate) : Rated |
| 64 | 64 | { |
| 65 | - return $this->addRate('movie/'.$movie_id.'/rating', $rate); |
|
| 65 | + return $this->addRate('movie/' . $movie_id . '/rating', $rate); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function removeMovieRate(int $movie_id) : Rated |
| 74 | 74 | { |
| 75 | - return $this->removeRate('movie/'.$movie_id.'/rating'); |
|
| 75 | + return $this->removeRate('movie/' . $movie_id . '/rating'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function addTVShowRate(int $tv_id, float $rate) : Rated |
| 85 | 85 | { |
| 86 | - return $this->addRate('tv/'.$tv_id.'/rating', $rate); |
|
| 86 | + return $this->addRate('tv/' . $tv_id . '/rating', $rate); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function removeTVShowRate(int $tv_id) : Rated |
| 95 | 95 | { |
| 96 | - return $this->removeRate('tv/'.$tv_id.'/rating'); |
|
| 96 | + return $this->removeRate('tv/' . $tv_id . '/rating'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function addTVShowEpisodeRate(int $tv_id, int $season_number, int $episode_number, float $rate) : Rated |
| 108 | 108 | { |
| 109 | - return $this->addRate('tv/'.$tv_id.'/season/'.$season_number.'/episode/'.$episode_number.'/rating', $rate); |
|
| 109 | + return $this->addRate('tv/' . $tv_id . '/season/' . $season_number . '/episode/' . $episode_number . '/rating', $rate); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function removeTVShowEpisodeRate(int $tv_id, int $season_number, int $episode_number) : Rated |
| 120 | 120 | { |
| 121 | - return $this->removeRate('tv/'.$tv_id.'/season/'.$season_number.'/episode/'.$episode_number.'/rating'); |
|
| 121 | + return $this->removeRate('tv/' . $tv_id . '/season/' . $season_number . '/episode/' . $episode_number . '/rating'); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -53,7 +53,8 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | try { |
| 55 | 55 | return $this->getList('genre/movie/list', $options); |
| 56 | - } catch (TmdbException $ex) { |
|
| 56 | + } |
|
| 57 | + catch (TmdbException $ex) { |
|
| 57 | 58 | throw $ex; |
| 58 | 59 | } |
| 59 | 60 | } |
@@ -68,7 +69,8 @@ discard block |
||
| 68 | 69 | { |
| 69 | 70 | try { |
| 70 | 71 | return $this->getList('genre/tv/list', $options); |
| 71 | - } catch (TmdbException $ex) { |
|
| 72 | + } |
|
| 73 | + catch (TmdbException $ex) { |
|
| 72 | 74 | throw $ex; |
| 73 | 75 | } |
| 74 | 76 | } |
@@ -92,7 +94,8 @@ discard block |
||
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 96 | return $this->genreItemGenerator($genres); |
| 95 | - } catch (TmdbException $ex) { |
|
| 97 | + } |
|
| 98 | + catch (TmdbException $ex) { |
|
| 96 | 99 | throw $ex; |
| 97 | 100 | } |
| 98 | 101 | } |
@@ -64,7 +64,8 @@ |
||
| 64 | 64 | $results[] = $result; |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | - } catch (TmdbException $ex) { |
|
| 67 | + } |
|
| 68 | + catch (TmdbException $ex) { |
|
| 68 | 69 | throw $ex; |
| 69 | 70 | } |
| 70 | 71 | return $this->genreItemGenerator($results); |
@@ -79,7 +79,8 @@ discard block |
||
| 79 | 79 | $this->total_results = (int) $response->total_results; |
| 80 | 80 | |
| 81 | 81 | return $this->searchItemGenerator($response->results, $result_class); |
| 82 | - } catch (TmdbException $ex) { |
|
| 82 | + } |
|
| 83 | + catch (TmdbException $ex) { |
|
| 83 | 84 | throw $ex; |
| 84 | 85 | } |
| 85 | 86 | } |
@@ -96,7 +97,8 @@ discard block |
||
| 96 | 97 | try { |
| 97 | 98 | $this->logger->debug('Starting search movie', array('query' => $query, 'options' => $options)); |
| 98 | 99 | return $this->searchItem('movie', $query, $options, Results\Movie::class); |
| 99 | - } catch (TmdbException $ex) { |
|
| 100 | + } |
|
| 101 | + catch (TmdbException $ex) { |
|
| 100 | 102 | throw $ex; |
| 101 | 103 | } |
| 102 | 104 | } |
@@ -113,7 +115,8 @@ discard block |
||
| 113 | 115 | try { |
| 114 | 116 | $this->logger->debug('Starting search tv show', array('query' => $query, 'options' => $options)); |
| 115 | 117 | return $this->searchItem('tv', $query, $options, Results\TVShow::class); |
| 116 | - } catch (TmdbException $ex) { |
|
| 118 | + } |
|
| 119 | + catch (TmdbException $ex) { |
|
| 117 | 120 | throw $ex; |
| 118 | 121 | } |
| 119 | 122 | } |
@@ -130,7 +133,8 @@ discard block |
||
| 130 | 133 | try { |
| 131 | 134 | $this->logger->debug('Starting search collection', array('query' => $query, 'options' => $options)); |
| 132 | 135 | return $this->searchItem('collection', $query, $options, Results\Collection::class); |
| 133 | - } catch (TmdbException $ex) { |
|
| 136 | + } |
|
| 137 | + catch (TmdbException $ex) { |
|
| 134 | 138 | throw $ex; |
| 135 | 139 | } |
| 136 | 140 | } |
@@ -147,7 +151,8 @@ discard block |
||
| 147 | 151 | try { |
| 148 | 152 | $this->logger->debug('Starting search people', array('query' => $query, 'options' => $options)); |
| 149 | 153 | return $this->searchItem('person', $query, $options, Results\People::class); |
| 150 | - } catch (TmdbException $ex) { |
|
| 154 | + } |
|
| 155 | + catch (TmdbException $ex) { |
|
| 151 | 156 | throw $ex; |
| 152 | 157 | } |
| 153 | 158 | } |
@@ -164,7 +169,8 @@ discard block |
||
| 164 | 169 | try { |
| 165 | 170 | $this->logger->debug('Starting search company', array('query' => $query, 'options' => $options)); |
| 166 | 171 | return $this->searchItem('company', $query, $options, Results\Company::class); |
| 167 | - } catch (TmdbException $ex) { |
|
| 172 | + } |
|
| 173 | + catch (TmdbException $ex) { |
|
| 168 | 174 | throw $ex; |
| 169 | 175 | } |
| 170 | 176 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | */ |
| 94 | 94 | private function checkSearchItemOption(array $options) : array |
| 95 | 95 | { |
| 96 | - $params = []; |
|
| 96 | + $params = []; |
|
| 97 | 97 | $this->tmdb->checkOptionQuery($options, $params); |
| 98 | 98 | $this->tmdb->checkOptionPage($options, $params); |
| 99 | 99 | $this->tmdb->checkOptionLanguage($options, $params); |
@@ -61,7 +61,8 @@ |
||
| 61 | 61 | ]); |
| 62 | 62 | |
| 63 | 63 | return $this->guzzleClient->request($method, $url, $params); |
| 64 | - } catch (RequestException $e) { |
|
| 64 | + } |
|
| 65 | + catch (RequestException $e) { |
|
| 65 | 66 | if (is_null($e->getResponse())) { |
| 66 | 67 | throw new HttpErrorException; |
| 67 | 68 | } |
@@ -35,7 +35,8 @@ |
||
| 35 | 35 | $this->cast_class = PeopleMovieCast::class; |
| 36 | 36 | |
| 37 | 37 | parent::__construct($tmdb, 'movie', $people_id, $options); |
| 38 | - } catch (TmdbException $ex) { |
|
| 38 | + } |
|
| 39 | + catch (TmdbException $ex) { |
|
| 39 | 40 | throw $ex; |
| 40 | 41 | } |
| 41 | 42 | } |