Completed
Push — V6 ( 9b19e1...52abd1 )
by Georges
03:32
created
src/phpFastCache/Drivers/Couchdb/Driver.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         if ($item instanceof Item) {
72 72
             try{
73 73
                 $this->instance->putDocument(['data' => $this->encode($this->driverPreWrap($item))], $item->getEncodedKey(), $this->getLatestDocumentRevision($item->getEncodedKey()));
74
-            }catch (CouchDBException $e){
74
+            } catch (CouchDBException $e){
75 75
                 throw new phpFastCacheDriverException('Got error while trying to upsert a document: ' . $e->getMessage(), null, $e);
76 76
             }
77 77
             return true;
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
     {
90 90
         try{
91 91
             $response = $this->instance->findDocument($item->getEncodedKey());
92
-        }catch (CouchDBException $e){
92
+        } catch (CouchDBException $e){
93 93
             throw new phpFastCacheDriverException('Got error while trying to get a document: ' . $e->getMessage(), null, $e);
94 94
         }
95 95
 
96 96
         if($response->status === 404 || empty($response->body['data'])){
97 97
             return null;
98
-        }else if($response->status === 200){
98
+        } else if($response->status === 200){
99 99
             return $this->decode($response->body['data']);
100
-        }else{
100
+        } else{
101 101
             throw new phpFastCacheDriverException('Got unexpected HTTP status: ' . $response->status);
102 102
         }
103 103
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         if ($item instanceof Item) {
117 117
             try{
118 118
                 $this->instance->deleteDocument($item->getEncodedKey(), $this->getLatestDocumentRevision($item->getEncodedKey()));
119
-            }catch (CouchDBException $e){
119
+            } catch (CouchDBException $e){
120 120
                 throw new phpFastCacheDriverException('Got error while trying to delete a document: ' . $e->getMessage(), null, $e);
121 121
             }
122 122
             return true;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         try{
135 135
             $this->instance->deleteDatabase($this->getDatabaseName());
136 136
             $this->createDatabase();
137
-        }catch (CouchDBException $e){
137
+        } catch (CouchDBException $e){
138 138
             throw new phpFastCacheDriverException('Got error while trying to delete and recreate the database: ' . $e->getMessage(), null, $e);
139 139
         }
140 140
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         );
200 200
         if(!empty($response->headers['etag'])){
201 201
             return trim($response->headers['etag'], " '\"\t\n\r\0\x0B");
202
-        }else{
202
+        } else{
203 203
             return null;
204 204
         }
205 205
     }
Please login to merge, or discard this patch.