Completed
Pull Request — final (#427)
by Georges
04:27 queued 02:09
created
src/phpFastCache/Core/StandardPsr6StructureTrait.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@
 block discarded – undo
77 77
                          * Reset the Item
78 78
                          */
79 79
                         $item->set(null)
80
-                          ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
81
-                          ->setHit(false)
82
-                          ->setTags([]);
80
+                            ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
81
+                            ->setHit(false)
82
+                            ->setTags([]);
83 83
                     } else {
84 84
                         $item->setHit(true);
85 85
                     }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 $driverArray = $this->driverRead($item);
58 58
 
59 59
                 if ($driverArray) {
60
-                    if(!is_array($driverArray)){
60
+                    if (!is_array($driverArray)) {
61 61
                         throw new phpFastCacheCoreException(sprintf('The driverRead method returned an unexpected variable type: %s', gettype($driverArray)));
62 62
                     }
63 63
                     $item->set($this->driverUnwrapData($driverArray));
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
                          * Reset the Item
78 78
                          */
79 79
                         $item->set(null)
80
-                          ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
80
+                          ->expiresAfter(abs((int) $this->getConfig()['defaultTtl']))
81 81
                           ->setHit(false)
82 82
                           ->setTags([]);
83 83
                     } else {
84 84
                         $item->setHit(true);
85 85
                     }
86 86
                 } else {
87
-                    $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]));
87
+                    $item->expiresAfter(abs((int) $this->getConfig()['defaultTtl']));
88 88
                 }
89 89
 
90 90
             }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.', gettype($key)));
93 93
         }
94 94
 
95
-        return $this->itemInstances[ $key ];
95
+        return $this->itemInstances[$key];
96 96
     }
97 97
 
98 98
     /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     public function setItem(CacheItemInterface $item)
104 104
     {
105 105
         if ($this->getClassNamespace() . '\\Item' === get_class($item)) {
106
-            $this->itemInstances[ $item->getKey() ] = $item;
106
+            $this->itemInstances[$item->getKey()] = $item;
107 107
 
108 108
             return $this;
109 109
         } else {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $collection = [];
122 122
         foreach ($keys as $key) {
123
-            $collection[ $key ] = $this->getItem($key);
123
+            $collection[$key] = $this->getItem($key);
124 124
         }
125 125
 
126 126
         return $collection;
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
          * @var ExtendedCacheItemInterface $item
203 203
          */
204 204
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
205
-            $this->itemInstances[ $item->getKey() ] = $item;
206
-        } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){
205
+            $this->itemInstances[$item->getKey()] = $item;
206
+        } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) {
207 207
             throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
208 208
         }
209 209
 
@@ -226,12 +226,12 @@  discard block
 block discarded – undo
226 226
     public function saveDeferred(CacheItemInterface $item)
227 227
     {
228 228
         if (!array_key_exists($item->getKey(), $this->itemInstances)) {
229
-            $this->itemInstances[ $item->getKey() ] = $item;
230
-        }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){
229
+            $this->itemInstances[$item->getKey()] = $item;
230
+        } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) {
231 231
             throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
232 232
         }
233 233
 
234
-        return $this->deferredList[ $item->getKey() ] = $item;
234
+        return $this->deferredList[$item->getKey()] = $item;
235 235
     }
236 236
 
237 237
     /**
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         foreach ($this->deferredList as $key => $item) {
245 245
             $result = $this->save($item);
246 246
             if ($return !== false) {
247
-                unset($this->deferredList[ $key ]);
247
+                unset($this->deferredList[$key]);
248 248
                 $return = $result;
249 249
             }
250 250
         }
Please login to merge, or discard this patch.