Passed
Branch account (184271)
by vincent
02:51
created
src/VfacTmdb/Search.php 2 patches
Braces   +34 added lines, -14 removed lines patch added patch discarded remove patch
@@ -61,10 +61,12 @@  discard block
 block discarded – undo
61 61
      */
62 62
     private function searchItem(string $item, string $query, array $options, string $result_class) : \Generator
63 63
     {
64
-        try {
64
+        try
65
+        {
65 66
             $this->logger->debug('Starting search item', array('item' => $item, 'query' => $query, 'options' => $options, 'result_class' => $result_class));
66 67
             $query = trim($query);
67
-            if (empty($query)) {
68
+            if (empty($query))
69
+            {
68 70
                 $this->logger->error('Query param cannot be empty', array('item' => $item, 'query' => $query, 'options' => $options, 'result_class' => $result_class));
69 71
                 throw new IncorrectParamException;
70 72
             }
@@ -77,7 +79,9 @@  discard block
 block discarded – undo
77 79
             $this->total_results = (int) $response->total_results;
78 80
 
79 81
             return $this->searchItemGenerator($response->results, $result_class);
80
-        } catch (TmdbException $ex) {
82
+        }
83
+        catch (TmdbException $ex)
84
+        {
81 85
             throw $ex;
82 86
         }
83 87
     }
@@ -90,7 +94,8 @@  discard block
 block discarded – undo
90 94
     private function searchItemGenerator(array $results, string $class)
91 95
     {
92 96
         $this->logger->debug('Starting search item generator', array('results' => $results, 'class' => $class));
93
-        foreach ($results as $result) {
97
+        foreach ($results as $result)
98
+        {
94 99
             $element = new $class($this->tmdb, $result);
95 100
 
96 101
             yield $element;
@@ -106,10 +111,13 @@  discard block
 block discarded – undo
106 111
      */
107 112
     public function movie(string $query, array $options = array()) : \Generator
108 113
     {
109
-        try {
114
+        try
115
+        {
110 116
             $this->logger->debug('Starting search movie', array('query' => $query, 'options' => $options));
111 117
             return $this->searchItem('movie', $query, $options, Results\Movie::class);
112
-        } catch (TmdbException $ex) {
118
+        }
119
+        catch (TmdbException $ex)
120
+        {
113 121
             throw $ex;
114 122
         }
115 123
     }
@@ -123,10 +131,13 @@  discard block
 block discarded – undo
123 131
      */
124 132
     public function tvshow(string $query, array $options = array()) : \Generator
125 133
     {
126
-        try {
134
+        try
135
+        {
127 136
             $this->logger->debug('Starting search tv show', array('query' => $query, 'options' => $options));
128 137
             return $this->searchItem('tv', $query, $options, Results\TVShow::class);
129
-        } catch (TmdbException $ex) {
138
+        }
139
+        catch (TmdbException $ex)
140
+        {
130 141
             throw $ex;
131 142
         }
132 143
     }
@@ -140,10 +151,13 @@  discard block
 block discarded – undo
140 151
      */
141 152
     public function collection(string $query, array $options = array()) : \Generator
142 153
     {
143
-        try {
154
+        try
155
+        {
144 156
             $this->logger->debug('Starting search collection', array('query' => $query, 'options' => $options));
145 157
             return $this->searchItem('collection', $query, $options, Results\Collection::class);
146
-        } catch (TmdbException $ex) {
158
+        }
159
+        catch (TmdbException $ex)
160
+        {
147 161
             throw $ex;
148 162
         }
149 163
     }
@@ -157,10 +171,13 @@  discard block
 block discarded – undo
157 171
      */
158 172
     public function people(string $query, array $options = array()) : \Generator
159 173
     {
160
-        try {
174
+        try
175
+        {
161 176
             $this->logger->debug('Starting search people', array('query' => $query, 'options' => $options));
162 177
             return $this->searchItem('person', $query, $options, Results\People::class);
163
-        } catch (TmdbException $ex) {
178
+        }
179
+        catch (TmdbException $ex)
180
+        {
164 181
             throw $ex;
165 182
         }
166 183
     }
@@ -174,10 +191,13 @@  discard block
 block discarded – undo
174 191
      */
175 192
     public function company(string $query, array $options = array()) : \Generator
176 193
     {
177
-        try {
194
+        try
195
+        {
178 196
             $this->logger->debug('Starting search company', array('query' => $query, 'options' => $options));
179 197
             return $this->searchItem('company', $query, $options, Results\Company::class);
180
-        } catch (TmdbException $ex) {
198
+        }
199
+        catch (TmdbException $ex)
200
+        {
181 201
             throw $ex;
182 202
         }
183 203
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Traits/ElementTrait.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function getPosterPath() : string
31 31
     {
32
-        if (isset($this->data->poster_path)) {
32
+        if (isset($this->data->poster_path))
33
+        {
33 34
             return $this->data->poster_path;
34 35
         }
35 36
         return '';
@@ -41,7 +42,8 @@  discard block
 block discarded – undo
41 42
      */
42 43
     public function getBackdropPath() : string
43 44
     {
44
-        if (isset($this->data->backdrop_path)) {
45
+        if (isset($this->data->backdrop_path))
46
+        {
45 47
             return $this->data->backdrop_path;
46 48
         }
47 49
         return '';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Abstracts/Item.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,14 +66,17 @@
 block discarded – undo
66 66
      */
67 67
     public function __construct(TmdbInterface $tmdb, int $item_id, array $options, string $item_name)
68 68
     {
69
-        try {
69
+        try
70
+        {
70 71
             $this->id     = $item_id;
71 72
             $this->tmdb   = $tmdb;
72 73
             $this->logger = $tmdb->getLogger();
73 74
             $this->conf   = $this->tmdb->getConfiguration();
74 75
             $this->params = $this->tmdb->checkOptions($options);
75 76
             $this->data   = $this->tmdb->getRequest($item_name . '/' . (int) $item_id, $this->params);
76
-        } catch (TmdbException $ex) {
77
+        }
78
+        catch (TmdbException $ex)
79
+        {
77 80
             throw $ex;
78 81
         }
79 82
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Abstracts/Results.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,10 @@
 block discarded – undo
64 64
 
65 65
         // Valid input object
66 66
         $properties = get_object_vars($this);
67
-        foreach (array_keys($properties) as $property) {
68
-            if (!in_array($property, $this->property_blacklist) && !property_exists($result, $property)) {
67
+        foreach (array_keys($properties) as $property)
68
+        {
69
+            if (!in_array($property, $this->property_blacklist) && !property_exists($result, $property))
70
+            {
69 71
                 throw new NotFoundException($property);
70 72
             }
71 73
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Exceptions/HttpErrorException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Exceptions/TmdbException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Exceptions/ServerErrorException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Exceptions/InvalidResponseException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
src/VfacTmdb/Exceptions/MissingDependencyException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.