| @@ -28,7 +28,7 @@ | ||
| 28 | 28 |      { | 
| 29 | 29 | $callReturn = json_decode($callReturn); | 
| 30 | 30 | |
| 31 | -        if($callReturn === null) { | |
| 31 | +        if ($callReturn === null) { | |
| 32 | 32 | throw new Exception(json_last_error_msg()); | 
| 33 | 33 | } | 
| 34 | 34 | } | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 | protected function checkLib() | 
| 98 | 98 |      { | 
| 99 | 99 | //Check curl php extension | 
| 100 | -        if(!function_exists('curl_init')) { | |
| 100 | +        if (!function_exists('curl_init')) { | |
| 101 | 101 |              throw new Exception('Please install or activate php-curl extension for use CallCurl plugin.'); | 
| 102 | 102 | } | 
| 103 | 103 | } | 
| @@ -111,15 +111,15 @@ discard block | ||
| 111 | 111 | */ | 
| 112 | 112 | protected function checkParser(&$parser) | 
| 113 | 113 |      { | 
| 114 | -        if(is_null($parser)) { | |
| 114 | +        if (is_null($parser)) { | |
| 115 | 115 | $parser = new DefaultParser; | 
| 116 | 116 | } | 
| 117 | 117 | |
| 118 | -        if(!is_object($parser)) { | |
| 118 | +        if (!is_object($parser)) { | |
| 119 | 119 |              throw new Exception('Parser should be an object instance.'); | 
| 120 | 120 | } | 
| 121 | 121 | |
| 122 | -        if(!($parser instanceof ParserInterface)) { | |
| 122 | +        if (!($parser instanceof ParserInterface)) { | |
| 123 | 123 |              throw new Exception('Parser should implement \bultonFr\Parser interface.'); | 
| 124 | 124 | } | 
| 125 | 125 | } | 
| @@ -135,7 +135,7 @@ discard block | ||
| 135 | 135 | */ | 
| 136 | 136 | public function setUrl($url) | 
| 137 | 137 |      { | 
| 138 | -        if(!is_string($url)) { | |
| 138 | +        if (!is_string($url)) { | |
| 139 | 139 |              throw new Exception('Url send to CallCurl should be a string variable'); | 
| 140 | 140 | } | 
| 141 | 141 | |
| @@ -190,7 +190,7 @@ discard block | ||
| 190 | 190 | */ | 
| 191 | 191 | public function setHttpMethod($method) | 
| 192 | 192 |      { | 
| 193 | -        if(!is_string($method)) { | |
| 193 | +        if (!is_string($method)) { | |
| 194 | 194 |              throw new Exception('HTTP method send to CallCurl should be a string variable'); | 
| 195 | 195 | } | 
| 196 | 196 | |
| @@ -211,7 +211,7 @@ discard block | ||
| 211 | 211 | */ | 
| 212 | 212 | public function setDebug($debug) | 
| 213 | 213 |      { | 
| 214 | -        if(!is_bool($debug)) { | |
| 214 | +        if (!is_bool($debug)) { | |
| 215 | 215 |              throw new Exception('Debug status send to CallCurl should be a boolean variable'); | 
| 216 | 216 | } | 
| 217 | 217 | |
| @@ -231,7 +231,7 @@ discard block | ||
| 231 | 231 | */ | 
| 232 | 232 | public function setCheckSSL($checkSSL) | 
| 233 | 233 |      { | 
| 234 | -        if(!is_bool($checkSSL)) { | |
| 234 | +        if (!is_bool($checkSSL)) { | |
| 235 | 235 |              throw new Exception('CheckSSL status send to CallCurl should be a boolean variable'); | 
| 236 | 236 | } | 
| 237 | 237 | |
| @@ -298,13 +298,13 @@ discard block | ||
| 298 | 298 | |
| 299 | 299 | $this->curlOptionsAddDatas($options); | 
| 300 | 300 | |
| 301 | -        if($this->debug === true) { | |
| 301 | +        if ($this->debug === true) { | |
| 302 | 302 | $options[CURLOPT_HEADER] = true; | 
| 303 | 303 | $options[CURLOPT_VERBOSE] = true; | 
| 304 | 304 | $options[CURLINFO_HEADER_OUT] = true; | 
| 305 | 305 | } | 
| 306 | 306 | |
| 307 | -        if($this->checkSSL === false) { | |
| 307 | +        if ($this->checkSSL === false) { | |
| 308 | 308 | $options[CURLOPT_SSL_VERIFYHOST] = false; | 
| 309 | 309 | $options[CURLOPT_SSL_VERIFYPEER] = false; | 
| 310 | 310 | } | 
| @@ -314,19 +314,19 @@ discard block | ||
| 314 | 314 | |
| 315 | 315 | protected function curlOptionsAddDatas(&$options) | 
| 316 | 316 |      { | 
| 317 | -        if(empty($this->datas)) { | |
| 317 | +        if (empty($this->datas)) { | |
| 318 | 318 | return; | 
| 319 | 319 | } | 
| 320 | 320 | |
| 321 | -        if($this->httpMethod === 'GET') { | |
| 321 | +        if ($this->httpMethod === 'GET') { | |
| 322 | 322 | |
| 323 | -            if(is_string($this->datas)) { | |
| 323 | +            if (is_string($this->datas)) { | |
| 324 | 324 | $datasUrl = urlencode($this->datas); | 
| 325 | 325 |              } else { | 
| 326 | 326 | $datasUrl = http_build_query($this->datas); | 
| 327 | 327 | } | 
| 328 | 328 | |
| 329 | -            if(strpos($this->url, '?') !== false) { | |
| 329 | +            if (strpos($this->url, '?') !== false) { | |
| 330 | 330 | $datasUrl = '&'.$datasUrl; | 
| 331 | 331 | } | 
| 332 | 332 |              else { | 
| @@ -337,7 +337,7 @@ discard block | ||
| 337 | 337 | return; | 
| 338 | 338 | } | 
| 339 | 339 | |
| 340 | -        if($this->httpMethod === 'POST') { | |
| 340 | +        if ($this->httpMethod === 'POST') { | |
| 341 | 341 | $options[CURLOPT_POST] = true; | 
| 342 | 342 | $options[CURLOPT_POSTFIELDS] = $this->datas; | 
| 343 | 343 | |
| @@ -328,8 +328,7 @@ | ||
| 328 | 328 | |
| 329 | 329 |              if(strpos($this->url, '?') !== false) { | 
| 330 | 330 | $datasUrl = '&'.$datasUrl; | 
| 331 | - } | |
| 332 | -            else { | |
| 331 | +            } else { | |
| 333 | 332 | $datasUrl = '?'.$datasUrl; | 
| 334 | 333 | } | 
| 335 | 334 | |