@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | 'MESSAGE' => $message, |
171 | 171 | ), JSON_PRETTY_PRINT); |
172 | 172 | |
173 | - if( isset($options['errors']) && $options['errors'] == 'catchAll' ) { |
|
173 | + if (isset($options['errors']) && $options['errors'] == 'catchAll') { |
|
174 | 174 | throw new \Exception($eMessage, 1); |
175 | 175 | } |
176 | 176 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | 'MESSAGE' => $message, |
186 | 186 | ), JSON_PRETTY_PRINT); |
187 | 187 | |
188 | - if( isset($options['errors']) && $options['errors'] == 'catchAll' ) { |
|
188 | + if (isset($options['errors']) && $options['errors'] == 'catchAll') { |
|
189 | 189 | throw new \Exception($eMessage, 1); |
190 | 190 | } |
191 | 191 |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * Check if a custom directory was set in the Responsible API options |
83 | 83 | */ |
84 | - if( (isset($this->options['classRoute']) && !empty($this->options['classRoute'])) && |
|
84 | + if ((isset($this->options['classRoute']) && !empty($this->options['classRoute'])) && |
|
85 | 85 | (isset($this->options['classRoute']['directory']) && isset($this->options['classRoute']['namespace'])) |
86 | 86 | ) { |
87 | 87 | $customService = $this->options['classRoute']; |
88 | 88 | $directory = $customService['directory']; |
89 | 89 | $middleware = $customService['namespace']; |
90 | 90 | |
91 | - }else { |
|
91 | + } else { |
|
92 | 92 | $middleware = 'responsible'; |
93 | 93 | |
94 | 94 | $endpoint = str_replace( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | if (class_exists($child)) { |
136 | 136 | self::$middleWareClass = new $child; |
137 | 137 | $this->registry[$point] = self::$middleWareClass->register(); |
138 | - }else{ |
|
138 | + } else { |
|
139 | 139 | (new exception\errorException) |
140 | 140 | ->message("Class Error:: class {$child} needs to exist. See documentation on setting up a service.") |
141 | 141 | ->error('NOT_EXTENDED'); |
@@ -206,16 +206,16 @@ discard block |
||
206 | 206 | * @var array |
207 | 207 | */ |
208 | 208 | if (array_search($endpoint, $this->registry[$api]) !== false) { |
209 | - if( method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope') ) { |
|
209 | + if (method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope')) { |
|
210 | 210 | $classScope = (new $this->NAMESPACE_ENDPOINTS[$api])->scope(); |
211 | 211 | $position = array_search($endpoint, $this->registry[$api]); |
212 | 212 | |
213 | - if( is_array($classScope) && isset($classScope[$position]) ) { |
|
213 | + if (is_array($classScope) && isset($classScope[$position])) { |
|
214 | 214 | $endpointSettings['model']['scope'] = $classScope[$position]; |
215 | 215 | |
216 | - }else{ |
|
216 | + } else { |
|
217 | 217 | |
218 | - if( !is_array($classScope) ) { |
|
218 | + if (!is_array($classScope)) { |
|
219 | 219 | $endpointSettings['model']['scope'] = $classScope; |
220 | 220 | } |
221 | 221 | } |
@@ -266,16 +266,16 @@ discard block |
||
266 | 266 | |
267 | 267 | $scope = 'private'; |
268 | 268 | |
269 | - if( method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope') ) { |
|
269 | + if (method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope')) { |
|
270 | 270 | $classScope = (new $this->NAMESPACE_ENDPOINTS[$api])->scope(); |
271 | 271 | $position = array_search($path, $this->registry[$api]); |
272 | 272 | |
273 | - if( is_array($classScope) && isset($classScope[$position]) ) { |
|
273 | + if (is_array($classScope) && isset($classScope[$position])) { |
|
274 | 274 | $scope = $classScope[$position]; |
275 | 275 | |
276 | - }else{ |
|
276 | + } else { |
|
277 | 277 | |
278 | - if( !is_array($classScope) ) { |
|
278 | + if (!is_array($classScope)) { |
|
279 | 279 | $scope = $classScope; |
280 | 280 | } |
281 | 281 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | foreach ($headers_list as $index => $headValue) { |
190 | 190 | @list($key, $value) = explode(": ", $headValue); |
191 | 191 | |
192 | - if (!is_null($key) && !is_null($value) ) { |
|
192 | + if (!is_null($key) && !is_null($value)) { |
|
193 | 193 | $headers_list[$key] = $value; |
194 | 194 | unset($headers_list[$index]); |
195 | 195 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $apacheRequestHeaders = apache_request_headers(); |
202 | 202 | } |
203 | 203 | |
204 | - if( is_null($apacheRequestHeaders) || empty($apacheRequestHeaders) ) { |
|
204 | + if (is_null($apacheRequestHeaders) || empty($apacheRequestHeaders)) { |
|
205 | 205 | return []; |
206 | 206 | } |
207 | 207 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | '*', |
260 | 260 | )); |
261 | 261 | |
262 | - if( !array_key_exists('Access-Control-Allow-Methods', $this->getHeaders()) ) { |
|
262 | + if (!array_key_exists('Access-Control-Allow-Methods', $this->getHeaders())) { |
|
263 | 263 | $this->setHeader('Access-Control-Allow-Methods', array( |
264 | 264 | 'GET,POST,OPTIONS', |
265 | 265 | )); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | ) |
459 | 459 | ); |
460 | 460 | |
461 | - if( empty($account) ) { |
|
461 | + if (empty($account)) { |
|
462 | 462 | $this->unauthorised(); |
463 | 463 | } |
464 | 464 |