@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -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 | } |
@@ -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 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function addMovieRate(int $movie_id, float $rate) : Rated |
66 | 66 | { |
67 | - return $this->addRate('movie/'.$movie_id.'/rating', $rate); |
|
67 | + return $this->addRate('movie/' . $movie_id . '/rating', $rate); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function removeMovieRate(int $movie_id) : Rated |
76 | 76 | { |
77 | - return $this->removeRate('movie/'.$movie_id.'/rating'); |
|
77 | + return $this->removeRate('movie/' . $movie_id . '/rating'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function addTVShowRate(int $tv_id, float $rate) : Rated |
87 | 87 | { |
88 | - return $this->addRate('tv/'.$tv_id.'/rating', $rate); |
|
88 | + return $this->addRate('tv/' . $tv_id . '/rating', $rate); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function removeTVShowRate(int $tv_id) : Rated |
97 | 97 | { |
98 | - return $this->removeRate('tv/'.$tv_id.'/rating'); |
|
98 | + return $this->removeRate('tv/' . $tv_id . '/rating'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function addTVShowEpisodeRate(int $tv_id, int $season_number, int $episode_number, float $rate) : Rated |
110 | 110 | { |
111 | - return $this->addRate('tv/'.$tv_id.'/season/'.$season_number.'/episode/'.$episode_number.'/rating', $rate); |
|
111 | + return $this->addRate('tv/' . $tv_id . '/season/' . $season_number . '/episode/' . $episode_number . '/rating', $rate); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function removeTVShowEpisodeRate(int $tv_id, int $season_number, int $episode_number) : Rated |
122 | 122 | { |
123 | - return $this->removeRate('tv/'.$tv_id.'/season/'.$season_number.'/episode/'.$episode_number.'/rating'); |
|
123 | + return $this->removeRate('tv/' . $tv_id . '/season/' . $season_number . '/episode/' . $episode_number . '/rating'); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -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 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -93,7 +93,7 @@ discard block |
||
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); |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -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 | } |
@@ -26,17 +26,17 @@ |
||
26 | 26 | * @author Vincent Faliès <[email protected]> |
27 | 27 | * @copyright Copyright (c) 2017 |
28 | 28 | */ |
29 | - class PeopleTVShowCredit extends PeopleItemCredit |
|
30 | - { |
|
31 | - public function __construct(TmdbInterface $tmdb, int $people_id, array $options = array()) |
|
32 | - { |
|
33 | - try { |
|
34 | - $this->crew_class = PeopleTVShowCrew::class; |
|
35 | - $this->cast_class = PeopleTVShowCast::class; |
|
29 | + class PeopleTVShowCredit extends PeopleItemCredit |
|
30 | + { |
|
31 | + public function __construct(TmdbInterface $tmdb, int $people_id, array $options = array()) |
|
32 | + { |
|
33 | + try { |
|
34 | + $this->crew_class = PeopleTVShowCrew::class; |
|
35 | + $this->cast_class = PeopleTVShowCast::class; |
|
36 | 36 | |
37 | - parent::__construct($tmdb, 'tv', $people_id, $options); |
|
38 | - } catch (TmdbException $ex) { |
|
39 | - throw $ex; |
|
40 | - } |
|
41 | - } |
|
42 | - } |
|
37 | + parent::__construct($tmdb, 'tv', $people_id, $options); |
|
38 | + } catch (TmdbException $ex) { |
|
39 | + throw $ex; |
|
40 | + } |
|
41 | + } |
|
42 | + } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -35,7 +35,8 @@ |
||
35 | 35 | $this->cast_class = PeopleTVShowCast::class; |
36 | 36 | |
37 | 37 | parent::__construct($tmdb, 'tv', $people_id, $options); |
38 | - } catch (TmdbException $ex) { |
|
38 | + } |
|
39 | + catch (TmdbException $ex) { |
|
39 | 40 | throw $ex; |
40 | 41 | } |
41 | 42 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -56,7 +56,6 @@ |
||
56 | 56 | return $this->setListItem('favorite', 'movie', $movie_id, true); |
57 | 57 | } |
58 | 58 | /** |
59 | - |
|
60 | 59 | * Unmark a movie as favorite |
61 | 60 | * @param int $movie_id Movie id |
62 | 61 | * @return Favorite |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -95,7 +95,8 @@ |
||
95 | 95 | $this->tmdb->postRequest('account/'.$this->account_id.'/'.$list_type, $this->options, $params); |
96 | 96 | |
97 | 97 | return $this; |
98 | - } catch (TmdbException $e) { |
|
98 | + } |
|
99 | + catch (TmdbException $e) { |
|
99 | 100 | throw $e; |
100 | 101 | } |
101 | 102 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $params['media_id'] = $media_id; |
110 | 110 | $params[$list_type] = $add; |
111 | 111 | |
112 | - $this->tmdb->postRequest('account/'.$this->account_id.'/'.$list_type, $this->options, $params); |
|
112 | + $this->tmdb->postRequest('account/' . $this->account_id . '/' . $list_type, $this->options, $params); |
|
113 | 113 | |
114 | 114 | return $this; |
115 | 115 | } catch (TmdbException $e) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $this->tmdb->checkOptionSortBy($this->options, $options); |
133 | 133 | $this->tmdb->checkOptionPage($this->options, $options); |
134 | 134 | |
135 | - $response = $this->tmdb->getRequest('account/'.$this->account_id.'/'.$list_type.'/'.$item, $options); |
|
135 | + $response = $this->tmdb->getRequest('account/' . $this->account_id . '/' . $list_type . '/' . $item, $options); |
|
136 | 136 | |
137 | 137 | $this->page = (int) $response->page; |
138 | 138 | $this->total_pages = (int) $response->total_pages; |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | /** |
3 | 3 | * This file is part of the Tmdb package. |
4 | 4 | * |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $options = []; |
78 | 78 | $this->tmdb->checkOptionLanguage($this->params, $options); |
79 | 79 | |
80 | - $data = $this->tmdb->getRequest($params->url, $options); |
|
80 | + $data = $this->tmdb->getRequest($params->url, $options); |
|
81 | 81 | |
82 | 82 | foreach ($data->$key as $b) { |
83 | 83 | $image = new Results\Image($this->tmdb, $this->id, $b); |