@@ -150,7 +150,7 @@ |
||
150 | 150 | |
151 | 151 | /** |
152 | 152 | * Check year format |
153 | - * @param mixed $year year to validate |
|
153 | + * @param integer $year year to validate |
|
154 | 154 | * @return int year validated |
155 | 155 | * @throws \Exception |
156 | 156 | */ |
@@ -9,11 +9,11 @@ |
||
9 | 9 | { |
10 | 10 | |
11 | 11 | // Private variables |
12 | - private $api_key = null; // API Key |
|
13 | - private $language = 'fr-FR'; // Default language for API response |
|
14 | - public $base_api_url = 'https://api.themoviedb.org/3/'; // Base URL of the API |
|
15 | - private $include_adult = false; // Include adult content in search result |
|
16 | - private $page = 1; // API Page result |
|
12 | + private $api_key = null; // API Key |
|
13 | + private $language = 'fr-FR'; // Default language for API response |
|
14 | + public $base_api_url = 'https://api.themoviedb.org/3/'; // Base URL of the API |
|
15 | + private $include_adult = false; // Include adult content in search result |
|
16 | + private $page = 1; // API Page result |
|
17 | 17 | // Protected variables |
18 | 18 | protected $configuration = null; // API Configuration |
19 | 19 | protected $genres = null; // API Genres |
@@ -104,8 +104,7 @@ |
||
104 | 104 | $this->configuration = $this->sendRequest(new CurlRequest(), 'configuration'); |
105 | 105 | } |
106 | 106 | return $this->configuration; |
107 | - } |
|
108 | - catch (\Exception $ex) |
|
107 | + } catch (\Exception $ex) |
|
109 | 108 | { |
110 | 109 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
111 | 110 | } |
@@ -21,8 +21,7 @@ |
||
21 | 21 | // Get tvshow details |
22 | 22 | $params = $this->tmdb->checkOptions($options); |
23 | 23 | $this->data = $this->tmdb->sendRequest(new CurlRequest(), 'tv/' . (int) $tv_id, null, $params); |
24 | - } |
|
25 | - catch (\Exception $ex) |
|
24 | + } catch (\Exception $ex) |
|
26 | 25 | { |
27 | 26 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
28 | 27 | } |
@@ -26,8 +26,7 @@ |
||
26 | 26 | |
27 | 27 | $params = $this->tmdb->checkOptions($options); |
28 | 28 | $this->data = $this->tmdb->sendRequest(new CurlRequest(), 'collection/' . (int) $collection_id, null, $params); |
29 | - } |
|
30 | - catch (\Exception $ex) |
|
29 | + } catch (\Exception $ex) |
|
31 | 30 | { |
32 | 31 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
33 | 32 | } |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | try |
29 | 29 | { |
30 | 30 | return $this->getList('genre/movie/list', $options); |
31 | - } |
|
32 | - catch (\Exception $ex) |
|
31 | + } catch (\Exception $ex) |
|
33 | 32 | { |
34 | 33 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
35 | 34 | } |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | try |
47 | 46 | { |
48 | 47 | return $this->getList('genre/tv/list', $options); |
49 | - } |
|
50 | - catch (\Exception $ex) |
|
48 | + } catch (\Exception $ex) |
|
51 | 49 | { |
52 | 50 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
53 | 51 | } |
@@ -74,8 +72,7 @@ discard block |
||
74 | 72 | } |
75 | 73 | |
76 | 74 | return $this->genreItemGenerator($genres); |
77 | - } |
|
78 | - catch (\Exception $ex) |
|
75 | + } catch (\Exception $ex) |
|
79 | 76 | { |
80 | 77 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
81 | 78 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | throw new \Exception('query parameter can not be empty'); |
40 | 40 | } |
41 | 41 | $params = $this->tmdb->checkOptions($options); |
42 | - $response = $this->tmdb->sendRequest(new CurlRequest(), 'search/'.$item, $query, $params); |
|
42 | + $response = $this->tmdb->sendRequest(new CurlRequest(), 'search/' . $item, $query, $params); |
|
43 | 43 | |
44 | 44 | $this->page = (int) $response->page; |
45 | 45 | $this->total_pages = (int) $response->total_pages; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | try |
81 | 81 | { |
82 | - return $this->searchItem('movie', $query, $options, __NAMESPACE__."\\Results\\".'Movie'); |
|
82 | + return $this->searchItem('movie', $query, $options, __NAMESPACE__ . "\\Results\\" . 'Movie'); |
|
83 | 83 | } |
84 | 84 | catch (\Exception $ex) |
85 | 85 | { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | try |
100 | 100 | { |
101 | - return $this->searchItem('tv', $query, $options, __NAMESPACE__."\\Results\\".'TVShow'); |
|
101 | + return $this->searchItem('tv', $query, $options, __NAMESPACE__ . "\\Results\\" . 'TVShow'); |
|
102 | 102 | } |
103 | 103 | catch (\Exception $ex) |
104 | 104 | { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | try |
119 | 119 | { |
120 | - return $this->searchItem('collection', $query, $options, __NAMESPACE__."\\Results\\".'Collection'); |
|
120 | + return $this->searchItem('collection', $query, $options, __NAMESPACE__ . "\\Results\\" . 'Collection'); |
|
121 | 121 | } |
122 | 122 | catch (\Exception $ex) |
123 | 123 | { |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | $this->total_results = (int) $response->total_results; |
47 | 47 | |
48 | 48 | return $this->searchItemGenerator($response->results, $result_class); |
49 | - } |
|
50 | - catch (\Exception $ex) |
|
49 | + } catch (\Exception $ex) |
|
51 | 50 | { |
52 | 51 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
53 | 52 | } |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | try |
81 | 80 | { |
82 | 81 | return $this->searchItem('movie', $query, $options, __NAMESPACE__."\\Results\\".'Movie'); |
83 | - } |
|
84 | - catch (\Exception $ex) |
|
82 | + } catch (\Exception $ex) |
|
85 | 83 | { |
86 | 84 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
87 | 85 | } |
@@ -99,8 +97,7 @@ discard block |
||
99 | 97 | try |
100 | 98 | { |
101 | 99 | return $this->searchItem('tv', $query, $options, __NAMESPACE__."\\Results\\".'TVShow'); |
102 | - } |
|
103 | - catch (\Exception $ex) |
|
100 | + } catch (\Exception $ex) |
|
104 | 101 | { |
105 | 102 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
106 | 103 | } |
@@ -118,8 +115,7 @@ discard block |
||
118 | 115 | try |
119 | 116 | { |
120 | 117 | return $this->searchItem('collection', $query, $options, __NAMESPACE__."\\Results\\".'Collection'); |
121 | - } |
|
122 | - catch (\Exception $ex) |
|
118 | + } catch (\Exception $ex) |
|
123 | 119 | { |
124 | 120 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
125 | 121 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $result = curl_exec($this->handle); |
36 | 36 | if ($result === false) |
37 | 37 | { |
38 | - throw new \Exception('cUrl failed : '.var_export($this->getInfo(), true), 1004); |
|
38 | + throw new \Exception('cUrl failed : ' . var_export($this->getInfo(), true), 1004); |
|
39 | 39 | } |
40 | 40 | return $result; |
41 | 41 | } |
@@ -51,8 +51,7 @@ |
||
51 | 51 | if (empty($name)) |
52 | 52 | { |
53 | 53 | $info = curl_getinfo($this->handle); |
54 | - } |
|
55 | - else |
|
54 | + } else |
|
56 | 55 | { |
57 | 56 | $info = curl_getinfo($this->handle, $name); |
58 | 57 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | // Get movie details |
29 | 29 | $params = $this->tmdb->checkOptions($options); |
30 | 30 | $this->data = $this->tmdb->sendRequest(new CurlRequest(), 'movie/' . $movie_id, null, $params); |
31 | - } |
|
32 | - catch (\Exception $ex) |
|
31 | + } catch (\Exception $ex) |
|
33 | 32 | { |
34 | 33 | throw new \Exception($ex->getMessage(), $ex->getCode(), $ex); |
35 | 34 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | class Collection extends Results |
6 | 6 | { |
7 | 7 | |
8 | - protected $name = null; |
|
8 | + protected $name = null; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Constructor |