Completed
Pull Request — final (#561)
by Georges
02:27
created
src/phpFastCache/Drivers/Sqlite/Driver.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
             $PDO = new PDO("sqlite:" . $this->SqliteDir . '/' . self::INDEXING_FILE);
153 153
             $PDO->setAttribute(PDO::ATTR_ERRMODE,
154
-              PDO::ERRMODE_EXCEPTION);
154
+                PDO::ERRMODE_EXCEPTION);
155 155
 
156 156
             if ($createTable == true) {
157 157
                 $this->initIndexing($PDO);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         // look for keyword
187 187
         $stm = $this->indexing->prepare("SELECT * FROM `balancing` WHERE `keyword`=:keyword LIMIT 1");
188 188
         $stm->execute([
189
-          ':keyword' => $keyword,
189
+            ':keyword' => $keyword,
190 190
         ]);
191 191
         $row = $stm->fetch(PDO::FETCH_ASSOC);
192 192
         if (isset($row[ 'db' ]) && $row[ 'db' ] != '') {
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
             $db = $this->currentDB;
199 199
             $stm = $this->indexing->prepare("INSERT INTO `balancing` (`keyword`,`db`) VALUES(:keyword, :db)");
200 200
             $stm->execute([
201
-              ':keyword' => $keyword,
202
-              ':db' => $db,
201
+                ':keyword' => $keyword,
202
+                ':db' => $db,
203 203
             ]);
204 204
         }
205 205
 
@@ -271,22 +271,22 @@  discard block
 block discarded – undo
271 271
                 $sql = "INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)";
272 272
                 try {
273 273
                     $stm = $this->getDb($item->getKey())
274
-                      ->prepare($sql);
274
+                        ->prepare($sql);
275 275
                     $stm->execute([
276
-                      ':keyword' => $item->getKey(),
277
-                      ':object' => $this->encode($this->driverPreWrap($item)),
278
-                      ':exp' => $item->getExpirationDate()->getTimestamp(),
276
+                        ':keyword' => $item->getKey(),
277
+                        ':object' => $this->encode($this->driverPreWrap($item)),
278
+                        ':exp' => $item->getExpirationDate()->getTimestamp(),
279 279
                     ]);
280 280
 
281 281
                     return true;
282 282
                 } catch (\PDOException $e) {
283 283
                     try {
284 284
                         $stm = $this->getDb($item->getKey(), true)
285
-                          ->prepare($sql);
285
+                            ->prepare($sql);
286 286
                         $stm->execute([
287
-                          ':keyword' => $item->getKey(),
288
-                          ':object' => $this->encode($this->driverPreWrap($item)),
289
-                          ':exp' => $item->getExpirationDate()->getTimestamp(),
287
+                            ':keyword' => $item->getKey(),
288
+                            ':object' => $this->encode($this->driverPreWrap($item)),
289
+                            ':exp' => $item->getExpirationDate()->getTimestamp(),
290 290
                         ]);
291 291
                     } catch (PDOException $e) {
292 292
                         return false;
@@ -309,17 +309,17 @@  discard block
 block discarded – undo
309 309
         $sql = "SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1";
310 310
         try {
311 311
             $stm = $this->getDb($item->getKey())
312
-              ->prepare($sql);
312
+                ->prepare($sql);
313 313
             $stm->execute([
314
-              ':keyword' => $item->getKey(),
314
+                ':keyword' => $item->getKey(),
315 315
             ]);
316 316
             $row = $stm->fetch(PDO::FETCH_ASSOC);
317 317
         } catch (PDOException $e) {
318 318
             try {
319 319
                 $stm = $this->getDb($item->getKey(), true)
320
-                  ->prepare($sql);
320
+                    ->prepare($sql);
321 321
                 $stm->execute([
322
-                  ':keyword' => $item->getKey(),
322
+                    ':keyword' => $item->getKey(),
323 323
                 ]);
324 324
                 $row = $stm->fetch(PDO::FETCH_ASSOC);
325 325
             } catch (PDOException $e) {
@@ -347,11 +347,11 @@  discard block
 block discarded – undo
347 347
         if ($item instanceof Item) {
348 348
             try {
349 349
                 $stm = $this->getDb($item->getKey())
350
-                  ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) ");
350
+                    ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) ");
351 351
 
352 352
                 return $stm->execute([
353
-                  ':keyword' => $item->getKey(),
354
-                  ':U' => time(),
353
+                    ':keyword' => $item->getKey(),
354
+                    ':U' => time(),
355 355
                 ]);
356 356
             } catch (PDOException $e) {
357 357
                 return false;
Please login to merge, or discard this patch.