Completed
Push — v5 ( 4b88c2...48ce1b )
by Georges
03:07
created
src/phpFastCache/Core/StandardPsr6StructureTrait.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     /**
159 159
      * @param \Psr\Cache\CacheItemInterface $item
160
-     * @return mixed
160
+     * @return boolean
161 161
      * @throws \InvalidArgumentException
162 162
      */
163 163
     public function save(CacheItemInterface $item)
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     }
176 176
 
177 177
     /**
178
-     * @return mixed|null
178
+     * @return boolean
179 179
      * @throws \InvalidArgumentException
180 180
      */
181 181
     public function commit()
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.', gettype($key)));
72 72
         }
73 73
 
74
-        return $this->itemInstances[ $key ];
74
+        return $this->itemInstances[$key];
75 75
     }
76 76
 
77 77
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function setItem(CacheItemInterface $item)
83 83
     {
84 84
         if ($this->getClassNamespace() . '\\Item' === get_class($item)) {
85
-            $this->itemInstances[ $item->getKey() ] = $item;
85
+            $this->itemInstances[$item->getKey()] = $item;
86 86
 
87 87
             return $this;
88 88
         } else {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $collection = [];
101 101
         foreach ($keys as $key) {
102
-            $collection[ $key ] = $this->getItem($key);
102
+            $collection[$key] = $this->getItem($key);
103 103
         }
104 104
 
105 105
         return $collection;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function deleteItem($key)
138 138
     {
139 139
         if ($this->hasItem($key) && $this->driverDelete($this->getItem($key))) {
140
-            unset($this->itemInstances[ $key ]);
140
+            unset($this->itemInstances[$key]);
141 141
 
142 142
             return true;
143 143
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function save(CacheItemInterface $item)
172 172
     {
173 173
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
174
-            $this->itemInstances[ $item->getKey() ] = $item;
174
+            $this->itemInstances[$item->getKey()] = $item;
175 175
         }
176 176
 
177 177
         return $this->driverWrite($item) && $this->driverWriteTags($item);
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
     public function saveDeferred(CacheItemInterface $item)
185 185
     {
186 186
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
187
-            $this->itemInstances[ $item->getKey() ] = $item;
187
+            $this->itemInstances[$item->getKey()] = $item;
188 188
         }
189 189
 
190
-        return $this->deferredList[ $item->getKey() ] = $item;
190
+        return $this->deferredList[$item->getKey()] = $item;
191 191
     }
192 192
 
193 193
     /**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         foreach ($this->deferredList as $key => $item) {
201 201
             $result = $this->save($item);
202 202
             if ($return !== false) {
203
-                unset($this->deferredList[ $key ]);
203
+                unset($this->deferredList[$key]);
204 204
                 $return = $result;
205 205
             }
206 206
         }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Couchbase/Driver.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
     }
129 129
 
130 130
     /**
131
-     * @return bool
131
+     * @return boolean|null
132 132
      */
133 133
     public function driverConnect()
134 134
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
             $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
143 143
             $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
144 144
             $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [
145
-              [
145
+                [
146 146
                 'bucket' => 'default',
147 147
                 'password' => '',
148
-              ],
148
+                ],
149 149
             ];
150 150
 
151 151
             $this->instance = $this->instance ?: new CouchbaseClient("couchbase://{$host}", $username, $password);
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
         $info = $this->getBucket()->manager()->info();
194 194
 
195 195
         return (new driverStatistic())
196
-          ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
197
-          ->setRawData($info)
198
-          ->setData(implode(', ', array_keys($this->itemInstances)))
199
-          ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, 1) . "\n For more information see RawData.");
196
+            ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
197
+            ->setRawData($info)
198
+            ->setData(implode(', ', array_keys($this->itemInstances)))
199
+            ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, 1) . "\n For more information see RawData.");
200 200
     }
201 201
 }
202 202
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
         } else {
138 138
 
139 139
 
140
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
140
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
141 141
             //$port = isset($server[ 'port' ]) ? $server[ 'port' ] : '11211';
142
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
143
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
144
-            $buckets = isset($this->config[ 'buckets' ]) ? $this->config[ 'buckets' ] : [
142
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
143
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
144
+            $buckets = isset($this->config['buckets']) ? $this->config['buckets'] : [
145 145
               [
146 146
                 'bucket' => 'default',
147 147
                 'password' => '',
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
             $this->instance = $this->instance ?: new CouchbaseClient("couchbase://{$host}", $username, $password);
152 152
 
153 153
             foreach ($buckets as $bucket) {
154
-                $this->bucketCurrent = $this->bucketCurrent ?: $bucket[ 'bucket' ];
155
-                $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ], $bucket[ 'password' ]));
154
+                $this->bucketCurrent = $this->bucketCurrent ?: $bucket['bucket'];
155
+                $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket'], $bucket['password']));
156 156
             }
157 157
         }
158 158
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     protected function getBucket()
164 164
     {
165
-        return $this->bucketInstances[ $this->bucketCurrent ];
165
+        return $this->bucketInstances[$this->bucketCurrent];
166 166
     }
167 167
 
168 168
     /**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     protected function setBucket($bucketName, \CouchbaseBucket $CouchbaseBucket)
174 174
     {
175 175
         if (!array_key_exists($bucketName, $this->bucketInstances)) {
176
-            $this->bucketInstances[ $bucketName ] = $CouchbaseBucket;
176
+            $this->bucketInstances[$bucketName] = $CouchbaseBucket;
177 177
         } else {
178 178
             throw new \LogicException('A bucket instance with this name already exists.');
179 179
         }
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
         $info = $this->getBucket()->manager()->info();
194 194
 
195 195
         return (new driverStatistic())
196
-          ->setSize($info[ 'basicStats' ][ 'diskUsed' ])
196
+          ->setSize($info['basicStats']['diskUsed'])
197 197
           ->setRawData($info)
198 198
           ->setData(implode(', ', array_keys($this->itemInstances)))
199
-          ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, 1) . "\n For more information see RawData.");
199
+          ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, 1) . "\n For more information see RawData.");
200 200
     }
201 201
 }
202 202
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devtrue/Driver.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
     /**
55 55
      * @param \Psr\Cache\CacheItemInterface $item
56
-     * @return mixed
56
+     * @return boolean
57 57
      * @throws \InvalidArgumentException
58 58
      */
59 59
     public function driverWrite(CacheItemInterface $item)
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     /**
72 72
      * @param $key
73
-     * @return mixed
73
+     * @return boolean
74 74
      */
75 75
     public function driverRead($key)
76 76
     {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -140,9 +140,9 @@
 block discarded – undo
140 140
     {
141 141
         $stat = new driverStatistic();
142 142
         $stat->setInfo('[Devtrue] A void info string')
143
-          ->setSize(0)
144
-          ->setData(implode(', ', array_keys($this->itemInstances)))
145
-          ->setRawData(true);
143
+            ->setSize(0)
144
+            ->setData(implode(', ', array_keys($this->itemInstances)))
145
+            ->setRawData(true);
146 146
 
147 147
         return $stat;
148 148
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Sqlite/Driver.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     }
212 212
 
213 213
     /**
214
-     * @param $keyword
214
+     * @param string $keyword
215 215
      * @param bool $reset
216 216
      * @return PDO
217 217
      */
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
     /**
250 250
      * @param \Psr\Cache\CacheItemInterface $item
251
-     * @return mixed
251
+     * @return boolean
252 252
      * @throws \InvalidArgumentException
253 253
      */
254 254
     public function driverWrite(CacheItemInterface $item)
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
     }
400 400
 
401 401
     /**
402
-     * @return bool
402
+     * @return boolean|null
403 403
      */
404 404
     public function driverConnect()
405 405
     {
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 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
 
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
             if ($toWrite == true) {
271 271
                 try {
272 272
                     $stm = $this->getDb($item->getKey())
273
-                      ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
273
+                        ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
274 274
                     $stm->execute([
275
-                      ':keyword' => $item->getKey(),
276
-                      ':object' => $this->encode($this->driverPreWrap($item)),
277
-                      ':exp' => time() + $item->getTtl(),
275
+                        ':keyword' => $item->getKey(),
276
+                        ':object' => $this->encode($this->driverPreWrap($item)),
277
+                        ':exp' => time() + $item->getTtl(),
278 278
                     ]);
279 279
 
280 280
                     return true;
@@ -282,11 +282,11 @@  discard block
 block discarded – undo
282 282
 
283 283
                     try {
284 284
                         $stm = $this->getDb($item->getKey(), true)
285
-                          ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
285
+                            ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
286 286
                         $stm->execute([
287
-                          ':keyword' => $item->getKey(),
288
-                          ':object' => $this->encode($this->driverPreWrap($item)),
289
-                          ':exp' => time() + $item->getTtl(),
287
+                            ':keyword' => $item->getKey(),
288
+                            ':object' => $this->encode($this->driverPreWrap($item)),
289
+                            ':exp' => time() + $item->getTtl(),
290 290
                         ]);
291 291
                     } catch (PDOException $e) {
292 292
                         return false;
@@ -308,20 +308,20 @@  discard block
 block discarded – undo
308 308
     {
309 309
         try {
310 310
             $stm = $this->getDb($item->getKey())
311
-              ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
311
+                ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
312 312
             $stm->execute([
313
-              ':keyword' => $item->getKey(),
314
-              ':U' => time(),
313
+                ':keyword' => $item->getKey(),
314
+                ':U' => time(),
315 315
             ]);
316 316
             $row = $stm->fetch(PDO::FETCH_ASSOC);
317 317
 
318 318
         } catch (PDOException $e) {
319 319
             try {
320 320
                 $stm = $this->getDb($item->getKey(), true)
321
-                  ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
321
+                    ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
322 322
                 $stm->execute([
323
-                  ':keyword' => $item->getKey(),
324
-                  ':U' => time(),
323
+                    ':keyword' => $item->getKey(),
324
+                    ':U' => time(),
325 325
                 ]);
326 326
                 $row = $stm->fetch(PDO::FETCH_ASSOC);
327 327
             } catch (PDOException $e) {
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
         if ($item instanceof Item) {
360 360
             try {
361 361
                 $stm = $this->getDb($item->getKey())
362
-                  //->prepare("DELETE FROM `caching` WHERE (`id`=:id) OR (`exp` <= :U) ");
363
-                  ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) ");
362
+                    //->prepare("DELETE FROM `caching` WHERE (`id`=:id) OR (`exp` <= :U) ");
363
+                    ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) ");
364 364
 
365 365
                 return $stm->execute([
366 366
                     // ':id' => $row[ 'id' ],
367
-                  ':keyword' => $item->getKey(),
368
-                  ':U' => time(),
367
+                    ':keyword' => $item->getKey(),
368
+                    ':U' => time(),
369 369
                 ]);
370 370
             } catch (PDOException $e) {
371 371
                 return false;
@@ -428,9 +428,9 @@  discard block
 block discarded – undo
428 428
         }
429 429
 
430 430
         $stat->setData(implode(', ', array_keys($this->itemInstances)))
431
-          ->setRawData([])
432
-          ->setSize(Directory::dirSize($path))
433
-          ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path));
431
+            ->setRawData([])
432
+            ->setSize(Directory::dirSize($path))
433
+            ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path));
434 434
 
435 435
         return $stat;
436 436
     }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
             $stm = $this->indexing->prepare("SELECT MAX(`db`) as `db` FROM `balancing`");
163 163
             $stm->execute();
164 164
             $row = $stm->fetch(PDO::FETCH_ASSOC);
165
-            if (!isset($row[ 'db' ])) {
165
+            if (!isset($row['db'])) {
166 166
                 $db = 1;
167
-            } elseif ($row[ 'db' ] <= 1) {
167
+            } elseif ($row['db'] <= 1) {
168 168
                 $db = 1;
169 169
             } else {
170
-                $db = $row[ 'db' ];
170
+                $db = $row['db'];
171 171
             }
172 172
 
173 173
             // check file size
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
           ':keyword' => $keyword,
190 190
         ]);
191 191
         $row = $stm->fetch(PDO::FETCH_ASSOC);
192
-        if (isset($row[ 'db' ]) && $row[ 'db' ] != '') {
193
-            $db = $row[ 'db' ];
192
+        if (isset($row['db']) && $row['db'] != '') {
193
+            $db = $row['db'];
194 194
         } else {
195 195
             /*
196 196
              * Insert new to Indexing
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         /**
222 222
          * init instant
223 223
          */
224
-        if (!isset($this->instance[ $instant ])) {
224
+        if (!isset($this->instance[$instant])) {
225 225
             // check DB Files ready or not
226 226
             $createTable = false;
227 227
             if (!file_exists($this->SqliteDir . '/db' . $instant) || $reset == true) {
@@ -234,12 +234,12 @@  discard block
 block discarded – undo
234 234
                 $this->initDB($PDO);
235 235
             }
236 236
 
237
-            $this->instance[ $instant ] = $PDO;
237
+            $this->instance[$instant] = $PDO;
238 238
             unset($PDO);
239 239
 
240 240
         }
241 241
 
242
-        return $this->instance[ $instant ];
242
+        return $this->instance[$instant];
243 243
     }
244 244
 
245 245
     /**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
          * Check for Cross-Driver type confusion
254 254
          */
255 255
         if ($item instanceof Item) {
256
-            $skipExisting = isset($this->config[ 'skipExisting' ]) ? $this->config[ 'skipExisting' ] : false;
256
+            $skipExisting = isset($this->config['skipExisting']) ? $this->config['skipExisting'] : false;
257 257
             $toWrite = true;
258 258
 
259 259
             // check in cache first
@@ -329,18 +329,18 @@  discard block
 block discarded – undo
329 329
             }
330 330
         }
331 331
 
332
-        if (isset($row[ 'id' ])) {
332
+        if (isset($row['id'])) {
333 333
             /**
334 334
              * @var $item ExtendedCacheItemInterface
335 335
              */
336
-            $item = $this->decode($row[ 'object' ]);
336
+            $item = $this->decode($row['object']);
337 337
             if ($item instanceof ExtendedCacheItemInterface && $item->isExpired()) {
338 338
                 $this->driverDelete($item);
339 339
 
340 340
                 return null;
341 341
             }
342 342
 
343
-            return $this->decode($row[ 'object' ]);
343
+            return $this->decode($row['object']);
344 344
         }
345 345
 
346 346
         return null;
Please login to merge, or discard this patch.
src/autoload.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         return;
28 28
     } else if (strpos($entity, 'Psr\Cache') === 0) {
29 29
         trigger_error('If you cannot use <b>composer</b>, you have to include manually the Psr\\Cache interfaces.<br />See: https://github.com/php-fig/cache/tree/master/src<br /> Called ' . $entity,
30
-          E_USER_ERROR);
30
+            E_USER_ERROR);
31 31
 
32 32
         return;
33 33
     }
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 
43 43
 if (class_exists('Composer\Autoload\ClassLoader')) {
44 44
     trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.',
45
-      E_USER_WARNING);
45
+        E_USER_WARNING);
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@
 block discarded – undo
17 17
 /**
18 18
  * Register Autoload
19 19
  */
20
-spl_autoload_register(function ($entity) {
20
+spl_autoload_register(function($entity) {
21 21
     $module = explode('\\', $entity, 2);
22
-    if (!in_array($module[ 0 ], ['phpFastCache', 'Psr'])) {
22
+    if (!in_array($module[0], ['phpFastCache', 'Psr'])) {
23 23
         /**
24 24
          * Not a part of phpFastCache file
25 25
          * then we return here.
Please login to merge, or discard this patch.
src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
                 return true;
28 28
             } else if (constant($CONSTANT_NAME) !== $driverName) {
29 29
                 trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours',
30
-                  E_USER_WARNING);
30
+                    E_USER_WARNING);
31 31
 
32 32
                 return false;
33 33
             }
Please login to merge, or discard this patch.
src/phpFastCache/Core/PathSeekerTrait.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
     protected static function cleanFileName($filename)
161 161
     {
162 162
         $regex = [
163
-          '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
164
-          '/\.$/',
165
-          '/^\./',
163
+            '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
164
+            '/\.$/',
165
+            '/^\./',
166 166
         ];
167 167
         $replace = ['-', '', ''];
168 168
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     chmod($path, 0777);
183 183
                 } catch (phpFastCacheDriverException $e) {
184 184
                     throw new phpFastCacheDriverException('PLEASE CHMOD ' . $path . ' - 0777 OR ANY WRITABLE PERMISSION!',
185
-                      92);
185
+                        92);
186 186
                 }
187 187
             }
188 188
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@  discard block
 block discarded – undo
25 25
     public $tmp = [];
26 26
 
27 27
     /**
28
-     * @param bool $skip_create_path
29 28
      * @param $config
30 29
      * @return string
31 30
      * @throws \Exception
@@ -118,7 +117,7 @@  discard block
 block discarded – undo
118 117
     }
119 118
 
120 119
     /**
121
-     * @param $keyword
120
+     * @param string|false $keyword
122 121
      * @param bool $skip
123 122
      * @return string
124 123
      * @throws phpFastCacheDriverException
@@ -165,7 +164,7 @@  discard block
 block discarded – undo
165 164
 
166 165
     /**
167 166
      * @param $filename
168
-     * @return mixed
167
+     * @return string
169 168
      */
170 169
     protected static function cleanFileName($filename)
171 170
     {
@@ -180,7 +179,7 @@  discard block
 block discarded – undo
180 179
     }
181 180
 
182 181
     /**
183
-     * @param $path
182
+     * @param string $path
184 183
      * @param bool $create
185 184
      * @throws \Exception
186 185
      */
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,30 +34,30 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();
36 36
 
37
-        if (!isset($this->config[ 'path' ]) || $this->config[ 'path' ] == '') {
37
+        if (!isset($this->config['path']) || $this->config['path'] == '') {
38 38
             if (self::isPHPModule()) {
39 39
                 $path = $tmp_dir;
40 40
             } else {
41
-                $document_root_path = rtrim($_SERVER[ 'DOCUMENT_ROOT' ], '/') . '/../';
42
-                $path = isset($_SERVER[ 'DOCUMENT_ROOT' ]) && is_writable($document_root_path) ? $document_root_path : rtrim(__DIR__, '/') . '/';
41
+                $document_root_path = rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/../';
42
+                $path = isset($_SERVER['DOCUMENT_ROOT']) && is_writable($document_root_path) ? $document_root_path : rtrim(__DIR__, '/') . '/';
43 43
             }
44 44
 
45
-            if ($this->config[ 'path' ] != '') {
46
-                $path = $this->config[ 'path' ];
45
+            if ($this->config['path'] != '') {
46
+                $path = $this->config['path'];
47 47
             }
48 48
 
49 49
         } else {
50
-            $path = $this->config[ 'path' ];
50
+            $path = $this->config['path'];
51 51
         }
52 52
 
53 53
         if ($getBasePath === true) {
54 54
             return $path;
55 55
         }
56 56
 
57
-        $securityKey = array_key_exists('securityKey', $this->config) ? $this->config[ 'securityKey' ] : '';
57
+        $securityKey = array_key_exists('securityKey', $this->config) ? $this->config['securityKey'] : '';
58 58
         if (!$securityKey || $securityKey === 'auto') {
59
-            if (isset($_SERVER[ 'HTTP_HOST' ])) {
60
-                $securityKey = preg_replace('/^www./', '', strtolower(str_replace(':', '_', $_SERVER[ 'HTTP_HOST' ])));
59
+            if (isset($_SERVER['HTTP_HOST'])) {
60
+                $securityKey = preg_replace('/^www./', '', strtolower(str_replace(':', '_', $_SERVER['HTTP_HOST'])));
61 61
             } else {
62 62
                 $securityKey = ($this->isPHPModule() ? 'web' : 'cli');
63 63
             }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $full_pathx = md5($full_path);
74 74
 
75 75
 
76
-        if (!isset($this->tmp[ $full_pathx ])) {
76
+        if (!isset($this->tmp[$full_pathx])) {
77 77
 
78 78
             if (!@file_exists($full_path) || !@is_writable($full_path)) {
79 79
                 if (!@file_exists($full_path)) {
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
                 }
98 98
             }
99 99
 
100
-            $this->tmp[ $full_pathx ] = true;
101
-            $this->htaccessGen($full_path, array_key_exists('htaccess', $this->config) ? $this->config[ 'htaccess' ] : false);
100
+            $this->tmp[$full_pathx] = true;
101
+            $this->htaccessGen($full_path, array_key_exists('htaccess', $this->config) ? $this->config['htaccess'] : false);
102 102
         }
103 103
 
104 104
         return realpath($full_path);
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public function setChmodAuto()
173 173
     {
174
-        if (!isset($this->config[ 'default_chmod' ]) || $this->config[ 'default_chmod' ] == '' || is_null($this->config[ 'default_chmod' ])) {
174
+        if (!isset($this->config['default_chmod']) || $this->config['default_chmod'] == '' || is_null($this->config['default_chmod'])) {
175 175
             return 0777;
176 176
         } else {
177
-            return $this->config[ 'default_chmod' ];
177
+            return $this->config['default_chmod'];
178 178
         }
179 179
     }
180 180
 
Please login to merge, or discard this patch.
src/phpFastCache/Cache/ItemBaseTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     public function removeTag($tagName)
350 350
     {
351 351
         if (($key = array_search($tagName, $this->tags)) !== false) {
352
-            unset($this->tags[ $key ]);
352
+            unset($this->tags[$key]);
353 353
             $this->removedTags[] = $tagName;
354 354
         }
355 355
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     final public function __debugInfo()
393 393
     {
394 394
         $info = get_object_vars($this);
395
-        $info[ 'driver' ] = 'object(' . get_class($info[ 'driver' ]) . ')';
395
+        $info['driver'] = 'object(' . get_class($info['driver']) . ')';
396 396
 
397 397
         return (array) $info;
398 398
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Predis/Driver.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function driverConnect()
128 128
     {
129
-        $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [
129
+        $server = isset($this->config['redis']) ? $this->config['redis'] : [
130 130
           'host' => '127.0.0.1',
131 131
           'port' => '6379',
132 132
           'password' => '',
@@ -134,32 +134,32 @@  discard block
 block discarded – undo
134 134
         ];
135 135
 
136 136
         $config = [
137
-          'host' => $server[ 'host' ],
137
+          'host' => $server['host'],
138 138
         ];
139 139
 
140
-        $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '';
140
+        $port = isset($server['port']) ? $server['port'] : '';
141 141
         if ($port != '') {
142
-            $config[ 'port' ] = $port;
142
+            $config['port'] = $port;
143 143
         }
144 144
 
145
-        $password = isset($server[ 'password' ]) ? $server[ 'password' ] : '';
145
+        $password = isset($server['password']) ? $server['password'] : '';
146 146
         if ($password != '') {
147
-            $config[ 'password' ] = $password;
147
+            $config['password'] = $password;
148 148
         }
149 149
 
150
-        $database = isset($server[ 'database' ]) ? $server[ 'database' ] : '';
150
+        $database = isset($server['database']) ? $server['database'] : '';
151 151
         if ($database != '') {
152
-            $config[ 'database' ] = $database;
152
+            $config['database'] = $database;
153 153
         }
154 154
 
155
-        $timeout = isset($server[ 'timeout' ]) ? $server[ 'timeout' ] : '';
155
+        $timeout = isset($server['timeout']) ? $server['timeout'] : '';
156 156
         if ($timeout != '') {
157
-            $config[ 'timeout' ] = $timeout;
157
+            $config['timeout'] = $timeout;
158 158
         }
159 159
 
160
-        $read_write_timeout = isset($server[ 'read_write_timeout' ]) ? $server[ 'read_write_timeout' ] : '';
160
+        $read_write_timeout = isset($server['read_write_timeout']) ? $server['read_write_timeout'] : '';
161 161
         if ($read_write_timeout != '') {
162
-            $config[ 'read_write_timeout' ] = $read_write_timeout;
162
+            $config['read_write_timeout'] = $read_write_timeout;
163 163
         }
164 164
 
165 165
         $this->instance = new PredisClient($config);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
     public function driverConnect()
128 128
     {
129 129
         $server = isset($this->config[ 'redis' ]) ? $this->config[ 'redis' ] : [
130
-          'host' => '127.0.0.1',
131
-          'port' => '6379',
132
-          'password' => '',
133
-          'database' => '',
130
+            'host' => '127.0.0.1',
131
+            'port' => '6379',
132
+            'password' => '',
133
+            'database' => '',
134 134
         ];
135 135
 
136 136
         $config = [
137
-          'host' => $server[ 'host' ],
137
+            'host' => $server[ 'host' ],
138 138
         ];
139 139
 
140 140
         $port = isset($server[ 'port' ]) ? $server[ 'port' ] : '';
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
     public function getStats()
197 197
     {
198 198
         return (new driverStatistic())
199
-          ->setRawData($this->instance->info())
200
-          ->setSize(0)
201
-          ->setInfo('');
199
+            ->setRawData($this->instance->info())
200
+            ->setSize(0)
201
+            ->setInfo('');
202 202
     }
203 203
 }
204 204
\ No newline at end of file
Please login to merge, or discard this patch.