diff --git a/src/Httpful/Request.php b/src/Httpful/Request.php index 87970a0..70f72c1 100755 --- a/src/Httpful/Request.php +++ b/src/Httpful/Request.php @@ -290,7 +290,8 @@ public function authenticateWithDigest($username, $password) /** * @return is this request setup for client side cert? */ - public function hasClientSideCert() { + public function hasClientSideCert() + { return isset($this->client_cert) && isset($this->client_key); } @@ -343,7 +344,7 @@ public function mime($mime) { if (empty($mime)) return $this; $this->content_type = $this->expected_type = Mime::getFullMime($mime); - if($this->isUpload()) { + if ($this->isUpload()) { $this->neverSerializePayload(); } return $this; @@ -388,7 +389,8 @@ public function expectsType($mime) return $this->expects($mime); } - public function attach($files) { + public function attach($files) + { foreach ($files as $key => $file) { if (function_exists('curl_file_create')) { $this->payload[$key] = curl_file_create($file); @@ -408,7 +410,7 @@ public function contentType($mime) { if (empty($mime)) return $this; $this->content_type = Mime::getFullMime($mime); - if($this->isUpload()) { + if ($this->isUpload()) { $this->neverSerializePayload(); } return $this; @@ -452,9 +454,10 @@ public function withStrictSSL() * @param string $auth_username Authentication username. Default null * @param string $auth_password Authentication password. Default null */ - public function useProxy($proxy_host, $proxy_port = 80, $auth_type = null, $auth_username = null, $auth_password = null){ + public function useProxy($proxy_host, $proxy_port = 80, $auth_type = null, $auth_username = null, $auth_password = null) + { $this->addOnCurlOption(CURLOPT_PROXY, "{$proxy_host}:{$proxy_port}"); - if(in_array($auth_type, array(CURLAUTH_BASIC,CURLAUTH_NTLM)) ){ + if (in_array($auth_type, array(CURLAUTH_BASIC,CURLAUTH_NTLM))) { $this->addOnCurlOption(CURLOPT_PROXYAUTH, $auth_type) ->addOnCurlOption(CURLOPT_PROXYUSERPWD, "{$auth_username}:{$auth_password}"); } @@ -464,7 +467,8 @@ public function useProxy($proxy_host, $proxy_port = 80, $auth_type = null, $auth /** * @return is this request setup for using proxy? */ - public function hasProxy(){ + public function hasProxy() + { return isset($this->additional_curl_opts[CURLOPT_PROXY]) && is_string($this->additional_curl_opts[CURLOPT_PROXY]); } @@ -830,7 +834,7 @@ public function _curlPrep() if (isset($this->payload)) { $this->serialized_payload = $this->_serializePayload($this->payload); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->serialized_payload); - if(!$this->isUpload()) { + if (!$this->isUpload()) { $this->headers['Content-Length'] = $this->_determineLength($this->serialized_payload); }