@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $validator = Validation::createValidator(); |
| 64 | 64 | |
| 65 | - if(isset($options['apiEndpoint'])){ |
|
| 65 | + if (isset($options['apiEndpoint'])) { |
|
| 66 | 66 | self::validateClientEndpoint($options, $validator); |
| 67 | 67 | self::$url = $options['apiEndpoint']; |
| 68 | 68 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->getOptions($method) |
| 143 | 143 | ); |
| 144 | 144 | |
| 145 | - if(!is_array($result)){ |
|
| 145 | + if (!is_array($result)) { |
|
| 146 | 146 | throw new Exception\UnexpectedError('Unexpected error :'.$result); |
| 147 | 147 | } |
| 148 | 148 | |
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | * @param [Validator] $validator |
| 206 | 206 | * @return void |
| 207 | 207 | */ |
| 208 | - private static function validateClientEndpoint($options, $validator){ |
|
| 208 | + private static function validateClientEndpoint($options, $validator) { |
|
| 209 | 209 | $violations = $validator->validate($options['apiEndpoint'], [ |
| 210 | 210 | new Url(), |
| 211 | 211 | ]); |
| 212 | - if(count($violations) != 0){ |
|
| 212 | + if (count($violations) != 0) { |
|
| 213 | 213 | throw new Exception\InvalidAttributeValue( |
| 214 | 214 | 'Your API endpoint is not a valid URL', |
| 215 | 215 | $violations |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $resultObject = new Error(); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if(!is_array($response)){ |
|
| 84 | + if (!is_array($response)) { |
|
| 85 | 85 | throw new UnexpectedError('Unexpected error : "'.$exception->getMessage().'"', $exception->getCode()); |
| 86 | 86 | } |
| 87 | 87 | |