@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | $driverArray = $this->driverRead($item); |
| 61 | 61 | |
| 62 | 62 | if ($driverArray) { |
| 63 | - if(!is_array($driverArray)){ |
|
| 63 | + if (!is_array($driverArray)) { |
|
| 64 | 64 | throw new phpFastCacheCoreException(sprintf('The driverRead method returned an unexpected variable type: %s', gettype($driverArray))); |
| 65 | 65 | } |
| 66 | 66 | $item->set($this->driverUnwrapData($driverArray)); |
| 67 | 67 | $item->expiresAt($this->driverUnwrapEdate($driverArray)); |
| 68 | 68 | |
| 69 | - if($this->config['itemDetailedDate']){ |
|
| 69 | + if ($this->config['itemDetailedDate']) { |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * If the itemDetailedDate has been |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | } else { |
| 91 | 91 | $item->setHit(true); |
| 92 | 92 | } |
| 93 | - }else{ |
|
| 94 | - $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])); |
|
| 93 | + } else { |
|
| 94 | + $item->expiresAfter(abs((int) $this->getConfig()['defaultTtl'])); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.', gettype($key))); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - return $this->itemInstances[ $key ]; |
|
| 102 | + return $this->itemInstances[$key]; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | public function setItem(CacheItemInterface $item) |
| 111 | 111 | { |
| 112 | 112 | if ($this->getClassNamespace() . '\\Item' === get_class($item)) { |
| 113 | - $this->itemInstances[ $item->getKey() ] = $item; |
|
| 113 | + $this->itemInstances[$item->getKey()] = $item; |
|
| 114 | 114 | |
| 115 | 115 | return $this; |
| 116 | 116 | } else { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $collection = []; |
| 129 | 129 | foreach ($keys as $key) { |
| 130 | - $collection[ $key ] = $this->getItem($key); |
|
| 130 | + $collection[$key] = $this->getItem($key); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | return $collection; |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | * @var ExtendedCacheItemInterface $item |
| 210 | 210 | */ |
| 211 | 211 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
| 212 | - $this->itemInstances[ $item->getKey() ] = $item; |
|
| 213 | - } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
| 212 | + $this->itemInstances[$item->getKey()] = $item; |
|
| 213 | + } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) { |
|
| 214 | 214 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
| 215 | 215 | } |
| 216 | 216 | |
@@ -233,12 +233,12 @@ discard block |
||
| 233 | 233 | public function saveDeferred(CacheItemInterface $item) |
| 234 | 234 | { |
| 235 | 235 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
| 236 | - $this->itemInstances[ $item->getKey() ] = $item; |
|
| 237 | - }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
| 236 | + $this->itemInstances[$item->getKey()] = $item; |
|
| 237 | + } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) { |
|
| 238 | 238 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - return $this->deferredList[ $item->getKey() ] = $item; |
|
| 241 | + return $this->deferredList[$item->getKey()] = $item; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | foreach ($this->deferredList as $key => $item) { |
| 252 | 252 | $result = $this->save($item); |
| 253 | 253 | if ($return !== false) { |
| 254 | - unset($this->deferredList[ $key ]); |
|
| 254 | + unset($this->deferredList[$key]); |
|
| 255 | 255 | $return = $result; |
| 256 | 256 | } |
| 257 | 257 | } |