Completed
Push — master ( 02f041...75f027 )
by vincent
05:00
created
src/Items/Company.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function getDescription()
49 49
     {
50
-        if (isset($this->data->description))
51
-        {
50
+        if (isset($this->data->description)) {
52 51
             return $this->data->description;
53 52
         }
54 53
         return '';
@@ -60,8 +59,7 @@  discard block
 block discarded – undo
60 59
      */
61 60
     public function getHeadQuarters()
62 61
     {
63
-        if (isset($this->data->headquarters))
64
-        {
62
+        if (isset($this->data->headquarters)) {
65 63
             return $this->data->headquarters;
66 64
         }
67 65
         return '';
@@ -73,8 +71,7 @@  discard block
 block discarded – undo
73 71
      */
74 72
     public function getHomePage()
75 73
     {
76
-        if (isset($this->data->homepage))
77
-        {
74
+        if (isset($this->data->homepage)) {
78 75
             return $this->data->homepage;
79 76
         }
80 77
         return '';
@@ -86,8 +83,7 @@  discard block
 block discarded – undo
86 83
      */
87 84
     public function getId()
88 85
     {
89
-        if (isset($this->data->id))
90
-        {
86
+        if (isset($this->data->id)) {
91 87
             return $this->data->id;
92 88
         }
93 89
         return 0;
@@ -99,8 +95,7 @@  discard block
 block discarded – undo
99 95
      */
100 96
     public function getLogoPath()
101 97
     {
102
-        if (isset($this->data->logo_path))
103
-        {
98
+        if (isset($this->data->logo_path)) {
104 99
             return $this->data->logo_path;
105 100
         }
106 101
         return '';
@@ -112,8 +107,7 @@  discard block
 block discarded – undo
112 107
      */
113 108
     public function getName()
114 109
     {
115
-        if (isset($this->data->name))
116
-        {
110
+        if (isset($this->data->name)) {
117 111
             return $this->data->name;
118 112
         }
119 113
         return '';
@@ -127,8 +121,7 @@  discard block
 block discarded – undo
127 121
     {
128 122
         $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/company/' . (int) $this->id . '/movies', null, $this->params);
129 123
 
130
-        foreach ($data->results as $m)
131
-        {
124
+        foreach ($data->results as $m) {
132 125
             $movie = new \vfalies\tmdb\Results\Movie($this->tmdb, $m);
133 126
             yield $movie;
134 127
         }
Please login to merge, or discard this patch.
src/Items/People.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function getAdult()
54 54
     {
55
-        if (isset($this->data->adult))
56
-        {
55
+        if (isset($this->data->adult)) {
57 56
             return $this->data->adult;
58 57
         }
59 58
         return false;
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
      */
66 65
     public function getAlsoKnownAs()
67 66
     {
68
-        if (isset($this->data->also_known_as))
69
-        {
67
+        if (isset($this->data->also_known_as)) {
70 68
             return $this->data->also_known_as;
71 69
         }
72 70
         return [];
@@ -78,8 +76,7 @@  discard block
 block discarded – undo
78 76
      */
79 77
     public function getBiography()
80 78
     {
81
-        if (isset($this->data->biography))
82
-        {
79
+        if (isset($this->data->biography)) {
83 80
             return $this->data->biography;
84 81
         }
85 82
         return '';
@@ -91,8 +88,7 @@  discard block
 block discarded – undo
91 88
      */
92 89
     public function getBirthday()
93 90
     {
94
-        if (isset($this->data->birthday))
95
-        {
91
+        if (isset($this->data->birthday)) {
96 92
             return $this->data->birthday;
97 93
         }
98 94
         return '';
@@ -104,8 +100,7 @@  discard block
 block discarded – undo
104 100
      */
105 101
     public function getDeathday()
106 102
     {
107
-        if (isset($this->data->deathday))
108
-        {
103
+        if (isset($this->data->deathday)) {
109 104
             return $this->data->deathday;
110 105
         }
111 106
         return '';
@@ -117,8 +112,7 @@  discard block
 block discarded – undo
117 112
      */
118 113
     public function getGender()
119 114
     {
120
-        if (isset($this->data->gender))
121
-        {
115
+        if (isset($this->data->gender)) {
122 116
             return $this->data->gender;
123 117
         }
124 118
         return 0;
@@ -130,8 +124,7 @@  discard block
 block discarded – undo
130 124
      */
131 125
     public function getHomepage()
132 126
     {
133
-        if (isset($this->data->homepage))
134
-        {
127
+        if (isset($this->data->homepage)) {
135 128
             return $this->data->homepage;
136 129
         }
137 130
         return '';
@@ -143,8 +136,7 @@  discard block
 block discarded – undo
143 136
      */
144 137
     public function getId()
145 138
     {
146
-        if (isset($this->data->id))
147
-        {
139
+        if (isset($this->data->id)) {
148 140
             return $this->data->id;
149 141
         }
150 142
         return 0;
@@ -156,8 +148,7 @@  discard block
 block discarded – undo
156 148
      */
157 149
     public function getImdbId()
158 150
     {
159
-        if (isset($this->data->imdb_id))
160
-        {
151
+        if (isset($this->data->imdb_id)) {
161 152
             return $this->data->imdb_id;
162 153
         }
163 154
         return '';
@@ -169,8 +160,7 @@  discard block
 block discarded – undo
169 160
      */
170 161
     public function getName()
171 162
     {
172
-        if (isset($this->data->name))
173
-        {
163
+        if (isset($this->data->name)) {
174 164
             return $this->data->name;
175 165
         }
176 166
         return '';
@@ -182,8 +172,7 @@  discard block
 block discarded – undo
182 172
      */
183 173
     public function getPlaceOfBirth()
184 174
     {
185
-        if (isset($this->data->place_of_birth))
186
-        {
175
+        if (isset($this->data->place_of_birth)) {
187 176
             return $this->data->place_of_birth;
188 177
         }
189 178
         return '';
@@ -195,8 +184,7 @@  discard block
 block discarded – undo
195 184
      */
196 185
     public function getPopularity()
197 186
     {
198
-        if (isset($this->data->popularity))
199
-        {
187
+        if (isset($this->data->popularity)) {
200 188
             return $this->data->popularity;
201 189
         }
202 190
         return 0;
@@ -208,8 +196,7 @@  discard block
 block discarded – undo
208 196
      */
209 197
     public function getProfilePath()
210 198
     {
211
-        if (isset($this->data->profile_path))
212
-        {
199
+        if (isset($this->data->profile_path)) {
213 200
             return $this->data->profile_path;
214 201
         }
215 202
         return '';
@@ -223,8 +210,7 @@  discard block
 block discarded – undo
223 210
     {
224 211
         $data = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), '/person/' . (int) $this->id . '/images', null, $this->params);
225 212
 
226
-        foreach ($data->profiles as $b)
227
-        {
213
+        foreach ($data->profiles as $b) {
228 214
             $image = new Image($this->tmdb, $this->id, $b);
229 215
             yield $image;
230 216
         }
Please login to merge, or discard this patch.
src/Items/PeopleMovieCredit.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,10 +44,8 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function getCrew()
46 46
     {
47
-        if (!empty($this->data->crew))
48
-        {
49
-            foreach ($this->data->crew as $c)
50
-            {
47
+        if (!empty($this->data->crew)) {
48
+            foreach ($this->data->crew as $c) {
51 49
                 $crew = new PeopleMovieCrew($this->tmdb, $c);
52 50
                 yield $crew;
53 51
             }
@@ -60,10 +58,8 @@  discard block
 block discarded – undo
60 58
      */
61 59
     public function getCast()
62 60
     {
63
-        if (!empty($this->data->cast))
64
-        {
65
-            foreach ($this->data->cast as $c)
66
-            {
61
+        if (!empty($this->data->cast)) {
62
+            foreach ($this->data->cast as $c) {
67 63
                 $cast = new PeopleMovieCast($this->tmdb, $c);
68 64
                 yield $cast;
69 65
             }
Please login to merge, or discard this patch.
src/Media.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,14 +119,12 @@
 block discarded – undo
119 119
      */
120 120
     private function getImage($type, $size, $filepath)
121 121
     {
122
-        if (!isset($this->conf->images->base_url))
123
-        {
122
+        if (!isset($this->conf->images->base_url)) {
124 123
             $this->logger->error('No image base url found from configuration');
125 124
             throw new NotFoundException;
126 125
         }
127 126
         $sizes = $type . '_sizes';
128
-        if (!in_array($size, $this->conf->images->$sizes))
129
-        {
127
+        if (!in_array($size, $this->conf->images->$sizes)) {
130 128
             $this->logger->error('Incorrect param image size', array('type' => $type, 'size' => $size, 'filepath' => $filepath));
131 129
             throw new IncorrectParamException;
132 130
         }
Please login to merge, or discard this patch.
src/Results/TVEpisode.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,10 +137,8 @@
 block discarded – undo
137 137
      */
138 138
     public function getGuestStars()
139 139
     {
140
-        if (isset($this->guest_stars))
141
-        {
142
-            foreach ($this->guest_stars as $gs)
143
-            {
140
+        if (isset($this->guest_stars)) {
141
+            foreach ($this->guest_stars as $gs) {
144 142
                 $gs->gender = null;
145 143
                 $gs->cast_id = null;
146 144
 
Please login to merge, or discard this patch.
src/Results/PeopleTVShowCrew.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,8 +87,7 @@
 block discarded – undo
87 87
      */
88 88
     public function __construct(TmdbInterface $tmdb, \stdClass $result)
89 89
     {
90
-        if (!isset($result->episode_count))
91
-        {
90
+        if (!isset($result->episode_count)) {
92 91
 $result->episode_count = null; }
93 92
         parent::__construct($tmdb, $result);
94 93
 
Please login to merge, or discard this patch.
src/Catalogs/Genres.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -51,12 +51,10 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function getMovieList(array $options = array())
53 53
     {
54
-        try
55
-        {
54
+        try {
56 55
             return $this->getList('genre/movie/list', $options);
57 56
         }
58
-        catch (TmdbException $ex)
59
-        {
57
+        catch (TmdbException $ex) {
60 58
             throw $ex;
61 59
         }
62 60
     }
@@ -69,12 +67,10 @@  discard block
 block discarded – undo
69 67
      */
70 68
     public function getTVList(array $options = array())
71 69
     {
72
-        try
73
-        {
70
+        try {
74 71
             return $this->getList('genre/tv/list', $options);
75 72
         }
76
-        catch (TmdbException $ex)
77
-        {
73
+        catch (TmdbException $ex) {
78 74
             throw $ex;
79 75
         }
80 76
     }
@@ -88,21 +84,18 @@  discard block
 block discarded – undo
88 84
      */
89 85
     private function getList($type, array $options)
90 86
     {
91
-        try
92
-        {
87
+        try {
93 88
             $params   = $this->tmdb->checkOptions($options);
94 89
             $response = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), $type, null, $params);
95 90
 
96 91
             $genres = [];
97
-            if (isset($response->genres))
98
-            {
92
+            if (isset($response->genres)) {
99 93
                 $genres = $response->genres;
100 94
             }
101 95
 
102 96
             return $this->genreItemGenerator($genres);
103 97
         }
104
-        catch (TmdbException $ex)
105
-        {
98
+        catch (TmdbException $ex) {
106 99
             throw $ex;
107 100
         }
108 101
     }
@@ -113,8 +106,7 @@  discard block
 block discarded – undo
113 106
      */
114 107
     private function genreItemGenerator(array $results)
115 108
     {
116
-        foreach ($results as $result)
117
-        {
109
+        foreach ($results as $result) {
118 110
             yield $result;
119 111
         }
120 112
     }
Please login to merge, or discard this patch.
src/Catalogs/Jobs.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,16 +50,13 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function getList(array $options = array())
52 52
     {
53
-        try
54
-        {
53
+        try {
55 54
             $params   = $this->tmdb->checkOptions($options);
56 55
             $response = $this->tmdb->sendRequest(new HttpClient(new \GuzzleHttp\Client()), 'job/list', null, $params);
57 56
 
58 57
             $results = [];
59
-            if (isset($response->jobs))
60
-            {
61
-                foreach ($response->jobs as $j)
62
-                {
58
+            if (isset($response->jobs)) {
59
+                foreach ($response->jobs as $j) {
63 60
                     $result             = new \stdClass();
64 61
                     $result->department = $j->department;
65 62
                     $result->jobs       = $j->job_list;
@@ -68,8 +65,7 @@  discard block
 block discarded – undo
68 65
                 }
69 66
             }
70 67
         }
71
-        catch (TmdbException $ex)
72
-        {
68
+        catch (TmdbException $ex) {
73 69
             throw $ex;
74 70
         }
75 71
         return $this->genreItemGenerator($results);
@@ -81,8 +77,7 @@  discard block
 block discarded – undo
81 77
      */
82 78
     private function genreItemGenerator(array $results)
83 79
     {
84
-        foreach ($results as $result)
85
-        {
80
+        foreach ($results as $result) {
86 81
             yield $result;
87 82
         }
88 83
     }
Please login to merge, or discard this patch.
src/Factory/Builder/MonologBuilder.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
     {
63 63
         $logger = new Logger($this->loggerName);
64 64
 
65
-        foreach ($this->handlersConfig as $config)
66
-        {
65
+        foreach ($this->handlersConfig as $config) {
67 66
             $handler = $this->newHandler($config['class'], $config['params']);
68 67
             $logger->pushHandler($handler);
69 68
         }
Please login to merge, or discard this patch.