@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Sqlite\Driver as SqliteDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
| 20 | 20 | use Phpfastcache\Exceptions\{ |
| 21 | - PhpfastcacheInvalidArgumentException |
|
| 21 | + PhpfastcacheInvalidArgumentException |
|
| 22 | 22 | }; |
| 23 | 23 | use Psr\Cache\CacheItemInterface; |
| 24 | 24 | |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $stat = new DriverStatistic(); |
| 131 | 131 | $stat->setInfo('[Memstatic] A memory static driver') |
| 132 | - ->setSize(mb_strlen(\serialize($this->staticStack))) |
|
| 133 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 134 | - ->setRawData($this->staticStack); |
|
| 132 | + ->setSize(mb_strlen(\serialize($this->staticStack))) |
|
| 133 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 134 | + ->setRawData($this->staticStack); |
|
| 135 | 135 | |
| 136 | 136 | return $stat; |
| 137 | 137 | } |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | protected function driverRead(CacheItemInterface $item) |
| 61 | 61 | { |
| 62 | 62 | $key = \md5($item->getKey()); |
| 63 | - if (isset($this->staticStack[ $key ])) { |
|
| 64 | - return $this->staticStack[ $key ]; |
|
| 63 | + if (isset($this->staticStack[$key])) { |
|
| 64 | + return $this->staticStack[$key]; |
|
| 65 | 65 | } |
| 66 | 66 | return null; |
| 67 | 67 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * Check for Cross-Driver type confusion |
| 78 | 78 | */ |
| 79 | 79 | if ($item instanceof Item) { |
| 80 | - $this->staticStack[ \md5($item->getKey()) ] = $this->driverPreWrap($item); |
|
| 80 | + $this->staticStack[\md5($item->getKey())] = $this->driverPreWrap($item); |
|
| 81 | 81 | return true; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | if ($item instanceof Item) { |
| 98 | 98 | $key = \md5($item->getKey()); |
| 99 | - if (isset($this->staticStack[ $key ])) { |
|
| 100 | - unset($this->staticStack[ $key ]); |
|
| 99 | + if (isset($this->staticStack[$key])) { |
|
| 100 | + unset($this->staticStack[$key]); |
|
| 101 | 101 | return true; |
| 102 | 102 | } |
| 103 | 103 | return false; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Memstatic\Driver as MemstaticDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
| 20 | 20 | use Phpfastcache\Exceptions\{ |
| 21 | - PhpfastcacheInvalidArgumentException |
|
| 21 | + PhpfastcacheInvalidArgumentException |
|
| 22 | 22 | }; |
| 23 | 23 | use Psr\Cache\CacheItemInterface; |
| 24 | 24 | |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | $info = xcache_info(XC_TYPE_VAR, 0); |
| 126 | 126 | |
| 127 | 127 | return (new DriverStatistic()) |
| 128 | - ->setSize(abs($info[ 'size' ] - $info[ 'avail' ])) |
|
| 129 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 130 | - ->setInfo(\sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, \str_replace(' ', ', ', XCACHE_MODULES))) |
|
| 131 | - ->setRawData($info); |
|
| 128 | + ->setSize(abs($info[ 'size' ] - $info[ 'avail' ])) |
|
| 129 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 130 | + ->setInfo(\sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, \str_replace(' ', ', ', XCACHE_MODULES))) |
|
| 131 | + ->setRawData($info); |
|
| 132 | 132 | } |
| 133 | 133 | throw new \RuntimeException("PhpFastCache is not able to read Xcache configuration. Please put this to your php.ini:\n |
| 134 | 134 | [xcache.admin] |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | $info = xcache_info(XC_TYPE_VAR, 0); |
| 126 | 126 | |
| 127 | 127 | return (new DriverStatistic()) |
| 128 | - ->setSize(abs($info[ 'size' ] - $info[ 'avail' ])) |
|
| 128 | + ->setSize(abs($info['size'] - $info['avail'])) |
|
| 129 | 129 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 130 | 130 | ->setInfo(\sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, \str_replace(' ', ', ', XCACHE_MODULES))) |
| 131 | 131 | ->setRawData($info); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Xcache\Driver as XcacheDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Predis\Driver as PredisDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
| 20 | 20 | use Phpfastcache\Exceptions\{ |
| 21 | - PhpfastcacheInvalidArgumentException |
|
| 21 | + PhpfastcacheInvalidArgumentException |
|
| 22 | 22 | }; |
| 23 | 23 | use Psr\Cache\CacheItemInterface; |
| 24 | 24 | |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); |
| 134 | 134 | |
| 135 | 135 | return (new DriverStatistic()) |
| 136 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 137 | - ->setInfo(\sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
|
| 136 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 137 | + ->setInfo(\sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
|
| 138 | 138 | $stats[ 'num_entries' ])) |
| 139 | - ->setRawData($stats) |
|
| 140 | - ->setSize($stats[ 'mem_size' ]); |
|
| 139 | + ->setRawData($stats) |
|
| 140 | + ->setSize($stats[ 'mem_size' ]); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | \ No newline at end of file |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | if ($item instanceof Item) { |
| 88 | 88 | $ttl = $item->getExpirationDate()->getTimestamp() - \time(); |
| 89 | 89 | |
| 90 | - return (bool)apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
| 90 | + return (bool) apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * Check for Cross-Driver type confusion |
| 105 | 105 | */ |
| 106 | 106 | if ($item instanceof Item) { |
| 107 | - return (bool)apc_delete($item->getKey()); |
|
| 107 | + return (bool) apc_delete($item->getKey()); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function getStats(): DriverStatistic |
| 131 | 131 | { |
| 132 | - $stats = (array)apc_cache_info('user'); |
|
| 133 | - $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); |
|
| 132 | + $stats = (array) apc_cache_info('user'); |
|
| 133 | + $date = (new \DateTime())->setTimestamp($stats['start_time']); |
|
| 134 | 134 | |
| 135 | 135 | return (new DriverStatistic()) |
| 136 | 136 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 137 | 137 | ->setInfo(\sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
| 138 | - $stats[ 'num_entries' ])) |
|
| 138 | + $stats['num_entries'])) |
|
| 139 | 139 | ->setRawData($stats) |
| 140 | - ->setSize($stats[ 'mem_size' ]); |
|
| 140 | + ->setSize($stats['mem_size']); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | \ No newline at end of file |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Apc\Driver as ApcDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
| 20 | 20 | use Phpfastcache\Exceptions\{ |
| 21 | - PhpfastcacheInvalidArgumentException |
|
| 21 | + PhpfastcacheInvalidArgumentException |
|
| 22 | 22 | }; |
| 23 | 23 | use Psr\Cache\CacheItemInterface; |
| 24 | 24 | |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $stat = new DriverStatistic(); |
| 114 | 114 | $stat->setInfo('[Devnull] A void info string') |
| 115 | - ->setSize(0) |
|
| 116 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 117 | - ->setRawData(null); |
|
| 115 | + ->setSize(0) |
|
| 116 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 117 | + ->setRawData(null); |
|
| 118 | 118 | |
| 119 | 119 | return $stat; |
| 120 | 120 | } |