Completed
Push — V6 ( 52abd1...beccf6 )
by Georges
02:21
created
src/phpFastCache/Core/Pool/DriverBaseTrait.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -159,9 +159,9 @@
 block discarded – undo
159 159
     public function driverPreWrap(ExtendedCacheItemInterface $item)
160 160
     {
161 161
         $wrap = [
162
-          self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
163
-          self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
164
-          self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(),
162
+            self::DRIVER_DATA_WRAPPER_INDEX => $item->get(),
163
+            self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(),
164
+            self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(),
165 165
         ];
166 166
 
167 167
         if($this->config['itemDetailedDate']){
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         if (is_array($config_name)) {
53 53
             $this->config = array_merge($this->config, $config_name);
54 54
         } else {
55
-            $this->config[ $config_name ] = $value;
55
+            $this->config[$config_name] = $value;
56 56
         }
57 57
     }
58 58
 
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function getConfigOption($optionName)
72 72
     {
73
-        if(isset($this->config[$optionName])){
73
+        if (isset($this->config[$optionName])) {
74 74
             return $this->config[$optionName];
75
-        }else{
75
+        } else {
76 76
             return null;
77 77
         }
78 78
     }
@@ -142,16 +142,16 @@  discard block
 block discarded – undo
142 142
           self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(),
143 143
         ];
144 144
 
145
-        if($this->config['itemDetailedDate']){
146
-            $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = new \DateTime();
145
+        if ($this->config['itemDetailedDate']) {
146
+            $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = new \DateTime();
147 147
             /**
148 148
              * If the creation date exists
149 149
              * reuse it else set a new Date
150 150
              */
151
-            $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime();
152
-        }else{
153
-            $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null;
154
-            $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null;
151
+            $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = $item->getCreationDate() ?: new \DateTime();
152
+        } else {
153
+            $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = null;
154
+            $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = null;
155 155
         }
156 156
 
157 157
         return $wrap;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function driverUnwrapData(array $wrapper)
165 165
     {
166
-        return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ];
166
+        return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX];
167 167
     }
168 168
 
169 169
     /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public function driverUnwrapTags(array $wrapper)
174 174
     {
175
-        return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ];
175
+        return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX];
176 176
     }
177 177
 
178 178
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      */
183 183
     public function driverUnwrapEdate(array $wrapper)
184 184
     {
185
-        return $wrapper[ self::DRIVER_EDATE_WRAPPER_INDEX ];
185
+        return $wrapper[self::DRIVER_EDATE_WRAPPER_INDEX];
186 186
     }
187 187
 
188 188
     /**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function driverUnwrapCdate(array $wrapper)
193 193
     {
194
-        return $wrapper[ self::DRIVER_CDATE_WRAPPER_INDEX ];
194
+        return $wrapper[self::DRIVER_CDATE_WRAPPER_INDEX];
195 195
     }
196 196
 
197 197
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     public function driverUnwrapMdate(array $wrapper)
203 203
     {
204
-        return $wrapper[ self::DRIVER_MDATE_WRAPPER_INDEX ];
204
+        return $wrapper[self::DRIVER_MDATE_WRAPPER_INDEX];
205 205
     }
206 206
 
207 207
     /**
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
          * on tags item, it can leads
227 227
          * to an infinite recursive calls
228 228
          */
229
-        if(strpos($item->getKey(), self::DRIVER_TAGS_KEY_PREFIX ) === 0){
229
+        if (strpos($item->getKey(), self::DRIVER_TAGS_KEY_PREFIX) === 0) {
230 230
             throw new \LogicException('Trying to set tag(s) to an Tag item index: ' . $item->getKey());
231 231
         }
232 232
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         foreach ($tagsItems as $tagsItem) {
270 270
             $data = (array) $tagsItem->get();
271 271
 
272
-            unset($data[ $item->getKey() ]);
272
+            unset($data[$item->getKey()]);
273 273
             $tagsItem->set($data);
274 274
 
275 275
             /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         if(isset($this->config[$optionName])){
74 74
             return $this->config[$optionName];
75
-        }else{
75
+        } else{
76 76
             return null;
77 77
         }
78 78
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
              * reuse it else set a new Date
150 150
              */
151 151
             $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime();
152
-        }else{
152
+        } else{
153 153
             $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null;
154 154
             $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null;
155 155
         }
Please login to merge, or discard this patch.
src/phpFastCache/Util/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/Drivers/Sqlite/Driver.php 3 patches
Spacing   +11 added lines, -11 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,8 +329,8 @@  discard block
 block discarded – undo
329 329
             }
330 330
         }
331 331
 
332
-        if (isset($row[ 'object' ])) {
333
-            return $this->decode($row[ 'object' ]);
332
+        if (isset($row['object'])) {
333
+            return $this->decode($row['object']);
334 334
         }
335 335
 
336 336
         return null;
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
             $PDO = new PDO("sqlite:" . $this->SqliteDir . '/' . self::INDEXING_FILE);
155 155
             $PDO->setAttribute(PDO::ATTR_ERRMODE,
156
-              PDO::ERRMODE_EXCEPTION);
156
+                PDO::ERRMODE_EXCEPTION);
157 157
 
158 158
             if ($createTable == true) {
159 159
                 $this->initIndexing($PDO);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         // look for keyword
189 189
         $stm = $this->indexing->prepare("SELECT * FROM `balancing` WHERE `keyword`=:keyword LIMIT 1");
190 190
         $stm->execute([
191
-          ':keyword' => $keyword,
191
+            ':keyword' => $keyword,
192 192
         ]);
193 193
         $row = $stm->fetch(PDO::FETCH_ASSOC);
194 194
         if (isset($row[ 'db' ]) && $row[ 'db' ] != '') {
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
             $db = $this->currentDB;
201 201
             $stm = $this->indexing->prepare("INSERT INTO `balancing` (`keyword`,`db`) VALUES(:keyword, :db)");
202 202
             $stm->execute([
203
-              ':keyword' => $keyword,
204
-              ':db' => $db,
203
+                ':keyword' => $keyword,
204
+                ':db' => $db,
205 205
             ]);
206 206
         }
207 207
 
@@ -272,11 +272,11 @@  discard block
 block discarded – undo
272 272
             if ($toWrite == true) {
273 273
                 try {
274 274
                     $stm = $this->getDb($item->getKey())
275
-                      ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
275
+                        ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
276 276
                     $stm->execute([
277
-                      ':keyword' => $item->getKey(),
278
-                      ':object' => $this->encode($this->driverPreWrap($item)),
279
-                      ':exp' => time() + $item->getTtl(),
277
+                        ':keyword' => $item->getKey(),
278
+                        ':object' => $this->encode($this->driverPreWrap($item)),
279
+                        ':exp' => time() + $item->getTtl(),
280 280
                     ]);
281 281
 
282 282
                     return true;
@@ -284,11 +284,11 @@  discard block
 block discarded – undo
284 284
 
285 285
                     try {
286 286
                         $stm = $this->getDb($item->getKey(), true)
287
-                          ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
287
+                            ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)");
288 288
                         $stm->execute([
289
-                          ':keyword' => $item->getKey(),
290
-                          ':object' => $this->encode($this->driverPreWrap($item)),
291
-                          ':exp' => time() + $item->getTtl(),
289
+                            ':keyword' => $item->getKey(),
290
+                            ':object' => $this->encode($this->driverPreWrap($item)),
291
+                            ':exp' => time() + $item->getTtl(),
292 292
                         ]);
293 293
                     } catch (PDOException $e) {
294 294
                         return false;
@@ -310,20 +310,20 @@  discard block
 block discarded – undo
310 310
     {
311 311
         try {
312 312
             $stm = $this->getDb($item->getKey())
313
-              ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
313
+                ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
314 314
             $stm->execute([
315
-              ':keyword' => $item->getKey(),
316
-              ':U' => time(),
315
+                ':keyword' => $item->getKey(),
316
+                ':U' => time(),
317 317
             ]);
318 318
             $row = $stm->fetch(PDO::FETCH_ASSOC);
319 319
 
320 320
         } catch (PDOException $e) {
321 321
             try {
322 322
                 $stm = $this->getDb($item->getKey(), true)
323
-                  ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
323
+                    ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword AND (`exp` >= :U)  LIMIT 1");
324 324
                 $stm->execute([
325
-                  ':keyword' => $item->getKey(),
326
-                  ':U' => time(),
325
+                    ':keyword' => $item->getKey(),
326
+                    ':U' => time(),
327 327
                 ]);
328 328
                 $row = $stm->fetch(PDO::FETCH_ASSOC);
329 329
             } catch (PDOException $e) {
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
         if ($item instanceof Item) {
352 352
             try {
353 353
                 $stm = $this->getDb($item->getKey())
354
-                  //->prepare("DELETE FROM `caching` WHERE (`id`=:id) OR (`exp` <= :U) ");
355
-                  ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) ");
354
+                    //->prepare("DELETE FROM `caching` WHERE (`id`=:id) OR (`exp` <= :U) ");
355
+                    ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) ");
356 356
 
357 357
                 return $stm->execute([
358 358
                     // ':id' => $row[ 'id' ],
359
-                  ':keyword' => $item->getKey(),
360
-                  ':U' => time(),
359
+                    ':keyword' => $item->getKey(),
360
+                    ':U' => time(),
361 361
                 ]);
362 362
             } catch (PDOException $e) {
363 363
                 return false;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     }
207 207
 
208 208
     /**
209
-     * @param $keyword
209
+     * @param string $keyword
210 210
      * @param bool $reset
211 211
      * @return PDO
212 212
      */
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
     /**
245 245
      * @param \Psr\Cache\CacheItemInterface $item
246
-     * @return mixed
246
+     * @return boolean
247 247
      * @throws phpFastCacheInvalidArgumentException
248 248
      */
249 249
     protected function driverWrite(CacheItemInterface $item)
Please login to merge, or discard this patch.
src/phpFastCache/Entities/driverStatistic.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     }
53 53
 
54 54
     /**
55
-     * @return int|bool Return size in octet or false if no information available
55
+     * @return string Return size in octet or false if no information available
56 56
      */
57 57
     public function getSize()
58 58
     {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     }
61 61
 
62 62
     /**
63
-     * @return mixed
63
+     * @return string
64 64
      */
65 65
     public function getData()
66 66
     {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     /**
71
-     * @param $info
71
+     * @param string $info
72 72
      * @return $this
73 73
      */
74 74
     public function setInfo($info)
Please login to merge, or discard this patch.
src/phpFastCache/Core/Pool/CacheItemPoolTrait.php 4 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                     } else {
86 86
                         $item->setHit(true);
87 87
                     }
88
-                }else{
88
+                } else{
89 89
                     $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]));
90 90
                 }
91 91
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     {
230 230
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
231 231
             $this->itemInstances[ $item->getKey() ] = $item;
232
-        }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){
232
+        } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){
233 233
             throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
234 234
         }
235 235
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
     /**
239 239
      * @param \Psr\Cache\CacheItemInterface $item
240
-     * @return mixed
240
+     * @return boolean
241 241
      * @throws phpFastCacheInvalidArgumentException
242 242
      * @throws \RuntimeException
243 243
      */
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     }
295 295
 
296 296
     /**
297
-     * @return mixed|null
297
+     * @return boolean
298 298
      * @throws phpFastCacheInvalidArgumentException
299 299
      */
300 300
     public function commit()
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,9 +108,9 @@
 block discarded – undo
108 108
                          * Reset the Item
109 109
                          */
110 110
                         $item->set(null)
111
-                          ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
112
-                          ->setHit(false)
113
-                          ->setTags([]);
111
+                            ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
112
+                            ->setHit(false)
113
+                            ->setTags([]);
114 114
                         if($this->config['itemDetailedDate']){
115 115
 
116 116
                             /**
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function getItem($key)
62 62
     {
63 63
         if (is_string($key)) {
64
-            if (preg_match('~([' . preg_quote(self::$unsupportedKeyChars, '~') . ']+)~', $key, $matches)){
64
+            if (preg_match('~([' . preg_quote(self::$unsupportedKeyChars, '~') . ']+)~', $key, $matches)) {
65 65
                 throw new phpFastCacheInvalidArgumentException('Unsupported key character detected: "' . $matches[1] . '". Please check: https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Unsupported-characters-in-key-identifiers');
66 66
             }
67 67
             if (!array_key_exists($key, $this->itemInstances)) {
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
                 $driverArray = $this->driverRead($item);
77 77
 
78 78
                 if ($driverArray) {
79
-                    if(!is_array($driverArray)){
79
+                    if (!is_array($driverArray)) {
80 80
                         throw new phpFastCacheCoreException(sprintf('The driverRead method returned an unexpected variable type: %s', gettype($driverArray)));
81 81
                     }
82 82
                     $item->set($this->driverUnwrapData($driverArray));
83 83
                     $item->expiresAt($this->driverUnwrapEdate($driverArray));
84 84
 
85
-                    if($this->config['itemDetailedDate']){
85
+                    if ($this->config['itemDetailedDate']) {
86 86
 
87 87
                         /**
88 88
                          * If the itemDetailedDate has been
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
                          * Reset the Item
109 109
                          */
110 110
                         $item->set(null)
111
-                          ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
111
+                          ->expiresAfter(abs((int) $this->getConfig()['defaultTtl']))
112 112
                           ->setHit(false)
113 113
                           ->setTags([]);
114
-                        if($this->config['itemDetailedDate']){
114
+                        if ($this->config['itemDetailedDate']) {
115 115
 
116 116
                             /**
117 117
                              * If the itemDetailedDate has been
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
                     } else {
125 125
                         $item->setHit(true);
126 126
                     }
127
-                }else{
128
-                    $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]));
127
+                } else {
128
+                    $item->expiresAfter(abs((int) $this->getConfig()['defaultTtl']));
129 129
                 }
130 130
 
131 131
             }
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
          * @param $this ExtendedCacheItemPoolInterface
139 139
          * @param $this ExtendedCacheItemInterface
140 140
          */
141
-        $this->eventManager->dispatch('CacheGetItem', $this, $this->itemInstances[ $key ]);
141
+        $this->eventManager->dispatch('CacheGetItem', $this, $this->itemInstances[$key]);
142 142
 
143
-        return $this->itemInstances[ $key ];
143
+        return $this->itemInstances[$key];
144 144
     }
145 145
 
146 146
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     public function setItem(CacheItemInterface $item)
152 152
     {
153 153
         if ($this->getClassNamespace() . '\\Item' === get_class($item)) {
154
-            $this->itemInstances[ $item->getKey() ] = $item;
154
+            $this->itemInstances[$item->getKey()] = $item;
155 155
 
156 156
             return $this;
157 157
         } else {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     {
169 169
         $collection = [];
170 170
         foreach ($keys as $key) {
171
-            $collection[ $key ] = $this->getItem($key);
171
+            $collection[$key] = $this->getItem($key);
172 172
         }
173 173
 
174 174
         return $collection;
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
          * @var ExtendedCacheItemInterface $item
266 266
          */
267 267
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
268
-            $this->itemInstances[ $item->getKey() ] = $item;
269
-        } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){
268
+            $this->itemInstances[$item->getKey()] = $item;
269
+        } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) {
270 270
             throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
271 271
         }
272 272
 
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
     public function saveDeferred(CacheItemInterface $item)
297 297
     {
298 298
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
299
-            $this->itemInstances[ $item->getKey() ] = $item;
300
-        }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){
299
+            $this->itemInstances[$item->getKey()] = $item;
300
+        } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) {
301 301
             throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
302 302
         }
303 303
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
          */
309 309
         $this->eventManager->dispatch('CacheSaveDeferredItem', $this, $item);
310 310
 
311
-        return $this->deferredList[ $item->getKey() ] = $item;
311
+        return $this->deferredList[$item->getKey()] = $item;
312 312
     }
313 313
 
314 314
     /**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         foreach ($this->deferredList as $key => $item) {
329 329
             $result = $this->save($item);
330 330
             if ($return !== false) {
331
-                unset($this->deferredList[ $key ]);
331
+                unset($this->deferredList[$key]);
332 332
                 $return = $result;
333 333
             }
334 334
         }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Zendshm/Driver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -133,8 +133,8 @@
 block discarded – undo
133 133
         $stats = (array) zend_shm_cache_info();
134 134
         return (new driverStatistic())
135 135
             ->setData(implode(', ', array_keys($this->namespaces)))
136
-            ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.",$stats[ 'items_total' ]))
136
+            ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total']))
137 137
             ->setRawData($stats)
138
-            ->setSize($stats[ 'memory_total' ]);
138
+            ->setSize($stats['memory_total']);
139 139
     }
140 140
 }
141 141
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/Helper/ActOnAll.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function __construct()
23 23
     {
24
-        $this->instances =& CacheManager::getInternalInstances();
24
+        $this->instances = & CacheManager::getInternalInstances();
25 25
     }
26 26
 
27 27
     /**
@@ -29,22 +29,22 @@  discard block
 block discarded – undo
29 29
      */
30 30
     protected function getGenericCallback()
31 31
     {
32
-        return function($method, $args){
32
+        return function($method, $args) {
33 33
             $getterMethod = (strpos($method, 'get') === 0);
34 34
             $return = false;
35 35
 
36
-            if($getterMethod){
36
+            if ($getterMethod) {
37 37
                 $return = [];
38 38
             }
39 39
 
40 40
             foreach ($this->instances as $instance)
41 41
             {
42 42
                 $reflectionMethod = new \ReflectionMethod(get_class($instance), $method);
43
-                if($getterMethod){
44
-                    $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args);
45
-                }else{
43
+                if ($getterMethod) {
44
+                    $return[$instance->getDriverName()] = $reflectionMethod->invokeArgs($instance, $args);
45
+                } else {
46 46
                     $result = $reflectionMethod->invokeArgs($instance, $args);
47
-                    if($result !== false){
47
+                    if ($result !== false) {
48 48
                         $return = $result;
49 49
                     }
50 50
                 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
                 $reflectionMethod = new \ReflectionMethod(get_class($instance), $method);
57 57
                 if($getterMethod){
58 58
                     $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args);
59
-                }else{
59
+                } else{
60 60
                     $result = $reflectionMethod->invokeArgs($instance, $args);
61 61
                     if($result !== false){
62 62
                         $return = $result;
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Memcache/Driver.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $this->instance = new MemcacheSoftware();
53 53
             $this->driverConnect();
54 54
 
55
-            if (array_key_exists('compress_data', $config) && $config[ 'compress_data' ] === true) {
55
+            if (array_key_exists('compress_data', $config) && $config['compress_data'] === true) {
56 56
                 $this->memcacheFlags = MEMCACHE_COMPRESSED;
57 57
             }
58 58
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     protected function driverConnect()
130 130
     {
131
-        $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
131
+        $servers = (!empty($this->config['memcache']) && is_array($this->config['memcache']) ? $this->config['memcache'] : []);
132 132
         if (count($servers) < 1) {
133 133
             $servers = [
134 134
               ['127.0.0.1', 11211],
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
         foreach ($servers as $server) {
139 139
             try {
140
-                if (!$this->instance->addserver($server[ 0 ], $server[ 1 ])) {
140
+                if (!$this->instance->addserver($server[0], $server[1])) {
141 141
                     $this->fallback = true;
142 142
                 }
143
-                if(!empty($server[ 'sasl_user' ]) && !empty($server[ 'sasl_password'])){
144
-                    $this->instance->setSaslAuthData($server[ 'sasl_user' ], $server[ 'sasl_password']);
143
+                if (!empty($server['sasl_user']) && !empty($server['sasl_password'])) {
144
+                    $this->instance->setSaslAuthData($server['sasl_user'], $server['sasl_password']);
145 145
                 }
146 146
             } catch (\Exception $e) {
147 147
                 $this->fallback = true;
@@ -161,16 +161,16 @@  discard block
 block discarded – undo
161 161
     public function getStats()
162 162
     {
163 163
         $stats = (array) $this->instance->getstats();
164
-        $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0);
165
-        $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion');
166
-        $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0);
164
+        $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0);
165
+        $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion');
166
+        $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0);
167 167
         
168
-        $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
168
+        $date = (new \DateTime())->setTimestamp(time() - $stats['uptime']);
169 169
 
170 170
         return (new driverStatistic())
171 171
           ->setData(implode(', ', array_keys($this->itemInstances)))
172
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
172
+          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822)))
173 173
           ->setRawData($stats)
174
-          ->setSize($stats[ 'bytes' ]);
174
+          ->setSize($stats['bytes']);
175 175
     }
176 176
 }
177 177
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $servers = (!empty($this->config[ 'memcache' ]) && is_array($this->config[ 'memcache' ]) ? $this->config[ 'memcache' ] : []);
131 131
         if (count($servers) < 1) {
132 132
             $servers = [
133
-              ['127.0.0.1', 11211],
133
+                ['127.0.0.1', 11211],
134 134
             ];
135 135
         }
136 136
 
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
         $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]);
161 161
 
162 162
         return (new driverStatistic())
163
-          ->setData(implode(', ', array_keys($this->itemInstances)))
164
-          ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
165
-          ->setRawData($stats)
166
-          ->setSize($stats[ 'bytes' ]);
163
+            ->setData(implode(', ', array_keys($this->itemInstances)))
164
+            ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822)))
165
+            ->setRawData($stats)
166
+            ->setSize($stats[ 'bytes' ]);
167 167
     }
168 168
 }
169 169
\ No newline at end of file
Please login to merge, or discard this patch.
src/autoload.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,6 +46,6 @@
 block discarded – undo
46 46
 });
47 47
 
48 48
 if ((!defined('PFC_IGNORE_COMPOSER_WARNING') || !PFC_IGNORE_COMPOSER_WARNING) && class_exists('Composer\Autoload\ClassLoader')) {
49
-  trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.',
49
+    trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.',
50 50
     E_USER_WARNING);
51 51
 }
52 52
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         if (is_readable($path)) {
33 33
             require_once $path;
34
-        }else{
34
+        } else{
35 35
             trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR);
36 36
         }
37 37
         return;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         if (is_readable($path)) {
42 42
             require_once $path;
43
-        }else{
43
+        } else{
44 44
             trigger_error('Cannot locate the Psr/SimpleCache files', E_USER_ERROR);
45 45
         }
46 46
         return;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * Register PhpFastCache
26 26
  * embedded-libraries Autoload
27 27
  */
28
-spl_autoload_register(function ($entity) {
28
+spl_autoload_register(function($entity) {
29 29
     /**
30 30
      * Attempting to load Psr\Cache
31 31
      */
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         if (is_readable($path)) {
36 36
             require_once $path;
37
-        }else{
37
+        } else {
38 38
             trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR);
39 39
         }
40 40
         return;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
         if (is_readable($path)) {
50 50
             require_once $path;
51
-        }else{
51
+        } else {
52 52
             trigger_error('Cannot locate the Psr/SimpleCache files', E_USER_ERROR);
53 53
         }
54 54
         return;
Please login to merge, or discard this patch.