@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (!class_exists('phpFastCache\CacheManager')) { |
| 19 | 19 | echo "[FAIL] Autoload failed to find the CacheManager\n"; |
| 20 | 20 | $status = 255; |
| 21 | -}else{ |
|
| 21 | +} else { |
|
| 22 | 22 | echo "[PASS] Autoload successfully found the CacheManager\n"; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | if (!interface_exists('Psr\Cache\CacheItemInterface')) { |
| 29 | 29 | echo "[FAIL] Autoload failed to find the Psr CacheItemInterface\n"; |
| 30 | 30 | $status = 255; |
| 31 | -}else{ |
|
| 31 | +} else { |
|
| 32 | 32 | echo "[PASS] Autoload successfully found the Psr CacheItemInterface\n"; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (!class_exists('phpFastCache\CacheManager')) { |
| 19 | 19 | echo "[FAIL] Autoload failed to find the CacheManager\n"; |
| 20 | 20 | $status = 255; |
| 21 | -}else{ |
|
| 21 | +} else{ |
|
| 22 | 22 | echo "[PASS] Autoload successfully found the CacheManager\n"; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | if (!interface_exists('Psr\Cache\CacheItemInterface')) { |
| 29 | 29 | echo "[FAIL] Autoload failed to find the Psr CacheItemInterface\n"; |
| 30 | 30 | $status = 255; |
| 31 | -}else{ |
|
| 31 | +} else{ |
|
| 32 | 32 | echo "[PASS] Autoload successfully found the Psr CacheItemInterface\n"; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function getItemsAsJsonString(array $keys = [], $option = 0, $depth = 512) |
| 49 | 49 | { |
| 50 | - $callback = function(CacheItemInterface $item){ |
|
| 50 | + $callback = function(CacheItemInterface $item) { |
|
| 51 | 51 | return $item->get(); |
| 52 | 52 | }; |
| 53 | 53 | return json_encode(array_map($callback, array_values($this->getItems($keys))), $option, $depth); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * |
| 76 | 76 | * #headache |
| 77 | 77 | */ |
| 78 | - return array_filter($this->getItems(array_unique(array_keys($items))), function(ExtendedCacheItemInterface $item){ |
|
| 78 | + return array_filter($this->getItems(array_unique(array_keys($items))), function(ExtendedCacheItemInterface $item) { |
|
| 79 | 79 | return $item->isHit(); |
| 80 | 80 | }); |
| 81 | 81 | } else { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function getItemsByTagsAsJsonString(array $tagNames, $option = 0, $depth = 512) |
| 119 | 119 | { |
| 120 | - $callback = function(CacheItemInterface $item){ |
|
| 120 | + $callback = function(CacheItemInterface $item) { |
|
| 121 | 121 | return $item->get(); |
| 122 | 122 | }; |
| 123 | 123 | |
@@ -302,15 +302,15 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | protected function deregisterItem($item) |
| 304 | 304 | { |
| 305 | - if($item instanceof CacheItemInterface){ |
|
| 306 | - unset($this->itemInstances[ $item->getKey() ]); |
|
| 305 | + if ($item instanceof CacheItemInterface) { |
|
| 306 | + unset($this->itemInstances[$item->getKey()]); |
|
| 307 | 307 | |
| 308 | - }else if(is_string($item)){ |
|
| 309 | - unset($this->itemInstances[ $item ]); |
|
| 310 | - }else{ |
|
| 308 | + } else if (is_string($item)) { |
|
| 309 | + unset($this->itemInstances[$item]); |
|
| 310 | + } else { |
|
| 311 | 311 | throw new \InvalidArgumentException('Invalid type for $item variable'); |
| 312 | 312 | } |
| 313 | - if(gc_enabled()){ |
|
| 313 | + if (gc_enabled()) { |
|
| 314 | 314 | gc_collect_cycles(); |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -305,9 +305,9 @@ |
||
| 305 | 305 | if($item instanceof CacheItemInterface){ |
| 306 | 306 | unset($this->itemInstances[ $item->getKey() ]); |
| 307 | 307 | |
| 308 | - }else if(is_string($item)){ |
|
| 308 | + } else if(is_string($item)){ |
|
| 309 | 309 | unset($this->itemInstances[ $item ]); |
| 310 | - }else{ |
|
| 310 | + } else{ |
|
| 311 | 311 | throw new \InvalidArgumentException('Invalid type for $item variable'); |
| 312 | 312 | } |
| 313 | 313 | if(gc_enabled()){ |
@@ -42,10 +42,10 @@ |
||
| 42 | 42 | if (!is_object($driverInstance->getItem('test'))) { |
| 43 | 43 | echo '[FAIL] $driverInstance->getItem() returned an invalid var type:' . gettype($driverInstance) . "\n"; |
| 44 | 44 | $status = 1; |
| 45 | -}else if(!($driverInstance->getItem('test') instanceof ExtendedCacheItemInterface)){ |
|
| 45 | +} else if (!($driverInstance->getItem('test') instanceof ExtendedCacheItemInterface)) { |
|
| 46 | 46 | echo '[FAIL] $driverInstance->getItem() returned an invalid class that does not implements ExtendedCacheItemInterface: ' . get_class($driverInstance) . "\n"; |
| 47 | 47 | $status = 1; |
| 48 | -}else{ |
|
| 48 | +} else { |
|
| 49 | 49 | echo '[PASS] $driverInstance->getItem() returned a valid class that implements ExtendedCacheItemInterface: ' . get_class($driverInstance) . "\n"; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -42,10 +42,10 @@ |
||
| 42 | 42 | if (!is_object($driverInstance->getItem('test'))) { |
| 43 | 43 | echo '[FAIL] $driverInstance->getItem() returned an invalid var type:' . gettype($driverInstance) . "\n"; |
| 44 | 44 | $status = 1; |
| 45 | -}else if(!($driverInstance->getItem('test') instanceof ExtendedCacheItemInterface)){ |
|
| 45 | +} else if(!($driverInstance->getItem('test') instanceof ExtendedCacheItemInterface)){ |
|
| 46 | 46 | echo '[FAIL] $driverInstance->getItem() returned an invalid class that does not implements ExtendedCacheItemInterface: ' . get_class($driverInstance) . "\n"; |
| 47 | 47 | $status = 1; |
| 48 | -}else{ |
|
| 48 | +} else{ |
|
| 49 | 49 | echo '[PASS] $driverInstance->getItem() returned a valid class that implements ExtendedCacheItemInterface: ' . get_class($driverInstance) . "\n"; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | use phpFastCache\Core\Item\ExtendedCacheItemInterface; |
| 9 | -use phpFastCache\Drivers\Memcached\Driver as MemcachedDriver; |
|
| 10 | 9 | use phpFastCache\Proxy\phpFastCacheAbstractProxy; |
| 11 | 10 | |
| 12 | 11 | |