diff --git CHANGELOG CHANGELOG
index 7754964..23e6b9d 100644
--- CHANGELOG
+++ CHANGELOG
@@ -1,5 +1,9 @@
 // $Id$
 
+Http Client 6.x-2.2, XXXX-XX-XX
+------------------------------
+by klausi: Coding style fixes
+
 Http Client 6.x-2.1, 2010-09-25
 ------------------------------
 #732308 by Jeffrey04, Hugo Wetterberg: Added missing function parameters while doing interpreting response
diff --git includes/HttpClient.inc includes/HttpClient.inc
index 11eb675..821e169 100644
--- includes/HttpClient.inc
+++ includes/HttpClient.inc
@@ -88,7 +88,7 @@ class HttpClient {
    */
   public function get($url, $parameters = array()) {
     return $this->execute(new HttpClientRequest($url, array(
-      'method' =>  'GET',
+      'method' => 'GET',
       'parameters' => $parameters,
     )));
   }
@@ -98,9 +98,9 @@ class HttpClient {
    */
   public function post($url, $data = NULL, $parameters = array()) {
     return $this->execute(new HttpClientRequest($url, array(
-      'method' =>  'POST',
+      'method' => 'POST',
       'parameters' => $parameters,
-      'data' => $data
+      'data' => $data,
     )));
   }
 
@@ -109,9 +109,9 @@ class HttpClient {
    */
   public function put($url, $data = NULL, $parameters = array()) {
     return $this->execute(new HttpClientRequest($url, array(
-      'method' =>  'PUT',
+      'method' => 'PUT',
       'parameters' => $parameters,
-      'data' => $data
+      'data' => $data,
     )));
   }
 
@@ -120,7 +120,7 @@ class HttpClient {
    */
   public function delete($url, $parameters = array()) {
     return $this->execute(new HttpClientRequest($url, array(
-      'method' =>  'DELETE',
+      'method' => 'DELETE',
       'parameters' => $parameters,
     )));
   }
@@ -140,7 +140,7 @@ class HttpClient {
         $request->data = $this->formatter->serialize($request->data);
       }
       else {
-        $request->data = (string)$request->data;
+        $request->data = (string) $request->data;
       }
       $request->setHeader('Content-length', strlen($request->data));
     }
@@ -189,13 +189,15 @@ class HttpClient {
   public static function urlencode_rfc3986($input) {
     if (is_array($input)) {
       return array_map(array('HttpClient', 'urlencode_rfc3986'), $input);
-    } else if (is_scalar($input)) {
+    }
+    else if (is_scalar($input)) {
       return str_replace(
         '+',
         ' ',
         str_replace('%7E', '~', rawurlencode($input))
       );
-    } else {
+    }
+    else {
       return '';
     }
   }
@@ -230,13 +232,13 @@ abstract class HttpClientDelegate {
     $client->rawResponse = $response;
     $split = preg_split('/\r\n\r\n/', $response, 2);
     if (!isset($split[1])) {
-      throw new HttpClientException('Error interpreting response', 0, (object)array(
+      throw new HttpClientException('Error interpreting response', 0, (object) array(
         'rawResponse' => $response,
       ));
     }
     list($headers, $body) = $split;
 
-    $obj = (object)array(
+    $obj = (object) array(
       'headers' => $headers,
       'body' => $body,
     );
@@ -312,7 +314,7 @@ class HttpClientBaseFormatter implements HttpClientFormatter {
    *  The serialized data as a string.
    */
   public function serialize($data) {
-    switch($this->format) {
+    switch ($this->format) {
       case self::FORMAT_PHP:
         return serialize($data);
         break;
@@ -334,9 +336,9 @@ class HttpClientBaseFormatter implements HttpClientFormatter {
    *  The unserialized data.
    */
   public function unserialize($data) {
-    switch($this->format) {
+    switch ($this->format) {
       case self::FORMAT_PHP:
-        if (($response = @unserialize($data))!==FALSE || $data === serialize(FALSE)) {
+        if (($response = @unserialize($data)) !== FALSE || $data === serialize(FALSE)) {
           return $response;
         }
         else {
@@ -459,7 +461,7 @@ class HttpClientRequest {
    *  The first value of the header will be returned.
    * @return string|array
    */
-  public function getHeader($name, $treat_as_single=TRUE) {
+  public function getHeader($name, $treat_as_single = TRUE) {
     $value = NULL;
 
     if (!empty($this->headers[$name])) {
@@ -546,11 +548,12 @@ class HttpClientRequest {
         foreach ($v as $va) {
           $total[] = HttpClient::urlencode_rfc3986($k) . "[]=" . HttpClient::urlencode_rfc3986($va);
         }
-      } else {
+      }
+      else {
         $total[] = HttpClient::urlencode_rfc3986($k) . "=" . HttpClient::urlencode_rfc3986($v);
       }
     }
     $out = implode("&", $total);
     return $this->url . '?' . $out;
   }
-}
\ No newline at end of file
+}
diff --git includes/HttpClientCurlDelegate.inc includes/HttpClientCurlDelegate.inc
index f562037..b87f6b6 100644
--- includes/HttpClientCurlDelegate.inc
+++ includes/HttpClientCurlDelegate.inc
@@ -3,13 +3,13 @@
 /**
  * A delegate for the HttpClient that uses curl to fetch data.
  */
-class HttpClientCurlDelegate extends HttpClientDelegate{
+class HttpClientCurlDelegate extends HttpClientDelegate {
   /**
    * Executes a request for the HttpClient.
    *
    * @param HttpClient $client
    *  The client we're acting as a delegate for.
-   * @param HttpClientRequest $request 
+   * @param HttpClientRequest $request
    *  The request to execute.
    * @return object
    *  The interpreted response.
@@ -22,7 +22,7 @@ class HttpClientCurlDelegate extends HttpClientDelegate{
     if (isset($request->options['curlopts'])) {
       $curlopts = $request->options['curlopts'] + $curlopts;
     }
-    
+
     $ch = $this->curl($request, $curlopts);
     $response = curl_exec($ch);
     $error = curl_error($ch);
@@ -31,7 +31,7 @@ class HttpClientCurlDelegate extends HttpClientDelegate{
     if ($error) {
       throw new HttpClientException('Curl Error: ' . $error);
     }
-    
+
     return $this->interpretResponse($client, $response);
   }
 
@@ -53,4 +53,4 @@ class HttpClientCurlDelegate extends HttpClientDelegate{
     curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders());
     return $ch;
   }
-}
\ No newline at end of file
+}
diff --git includes/HttpClientOAuth.inc includes/HttpClientOAuth.inc
index 9748b8c..2e1256c 100644
--- includes/HttpClientOAuth.inc
+++ includes/HttpClientOAuth.inc
@@ -10,7 +10,7 @@ class HttpClientOAuth implements HttpClientAuthentication {
   private $header_auth;
   private $realm;
 
-  public function __construct($consumer, $token=NULL, $sign_impl=NULL, $hash_body=TRUE, $header_auth=FALSE, $realm=NULL) {
+  public function __construct($consumer, $token = NULL, $sign_impl = NULL, $hash_body = TRUE, $header_auth = FALSE, $realm = NULL) {
     $this->consumer = $consumer;
     $this->token = $token;
     $this->signImpl = $sign_impl;
@@ -36,7 +36,7 @@ class HttpClientOAuth implements HttpClientAuthentication {
   /**
    * Used by the HttpClient to authenticate requests.
    *
-   * @param HttpClientRequest $request 
+   * @param HttpClientRequest $request
    * @return void
    */
   public function authenticate($request) {
@@ -74,4 +74,4 @@ class HttpClientOAuth implements HttpClientAuthentication {
       $request->setHeader($auth_header[0], trim($auth_header[1]));
     }
   }
-}
\ No newline at end of file
+}
diff --git includes/HttpClientXMLFormatter.inc includes/HttpClientXMLFormatter.inc
index d7cf194..230f95e 100644
--- includes/HttpClientXMLFormatter.inc
+++ includes/HttpClientXMLFormatter.inc
@@ -41,7 +41,8 @@ class HttpClientXMLFormatter implements HttpClientFormatter {
     if ($xml instanceof SimpleXMLElement) {
       // Only return data if we got well formed xml
       return $xml;
-    } else {
+    }
+    else {
       // Data was messed up
       throw new InvalidArgumentException('XML response was malformed.');
     }
@@ -79,8 +80,8 @@ class HttpClientXMLFormatter implements HttpClientFormatter {
         $parent->setAttribute('is_array', 'true');
       }
     }
-    else if ($data!==NULL) {
+    else if ($data !== NULL) {
       $parent->appendChild($doc->createTextNode($data));
     }
   }
-}
\ No newline at end of file
+}
