@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Devfalse; |
| 17 | 17 | |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | namespace Phpfastcache\Drivers\Devfalse; |
| 17 | 17 | |
| 18 | 18 | use Phpfastcache\Core\Pool\{ |
| 19 | - DriverBaseTrait, ExtendedCacheItemPoolInterface |
|
| 19 | + DriverBaseTrait, ExtendedCacheItemPoolInterface |
|
| 20 | 20 | }; |
| 21 | 21 | use Phpfastcache\Entities\DriverStatistic; |
| 22 | 22 | use Phpfastcache\Exceptions\{ |
| 23 | - PhpfastcacheInvalidArgumentException |
|
| 23 | + PhpfastcacheInvalidArgumentException |
|
| 24 | 24 | }; |
| 25 | 25 | use Psr\Cache\CacheItemInterface; |
| 26 | 26 | |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | protected function driverRead(CacheItemInterface $item): array |
| 67 | 67 | { |
| 68 | 68 | return [ |
| 69 | - self::DRIVER_DATA_WRAPPER_INDEX => false, |
|
| 70 | - self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
| 71 | - self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(), |
|
| 69 | + self::DRIVER_DATA_WRAPPER_INDEX => false, |
|
| 70 | + self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
| 71 | + self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(), |
|
| 72 | 72 | ]; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $stat = new DriverStatistic(); |
| 120 | 120 | $stat->setInfo('[Devfalse] A void info string') |
| 121 | - ->setSize(0) |
|
| 122 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 123 | - ->setRawData(false); |
|
| 121 | + ->setSize(0) |
|
| 122 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 123 | + ->setRawData(false); |
|
| 124 | 124 | |
| 125 | 125 | return $stat; |
| 126 | 126 | } |
@@ -16,12 +16,12 @@ |
||
| 16 | 16 | * @var array |
| 17 | 17 | */ |
| 18 | 18 | protected $servers = [ |
| 19 | - [ |
|
| 19 | + [ |
|
| 20 | 20 | 'host' => '127.0.0.1', |
| 21 | 21 | 'port' => 11211, |
| 22 | 22 | 'saslUser' => false, |
| 23 | 23 | 'saslPassword' => false, |
| 24 | - ], |
|
| 24 | + ], |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Riak; |
| 17 | 17 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 20 | 20 | use Phpfastcache\Entities\DriverStatistic; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
| 23 | 23 | }; |
| 24 | 24 | use Phpfastcache\Util\ArrayObject; |
| 25 | 25 | use Psr\Cache\CacheItemInterface; |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | if ($item instanceof Item) { |
| 91 | 91 | $this->instance |
| 92 | - ->bucket($this->bucketName) |
|
| 93 | - ->newBinary($item->getKey(), $this->encode($this->driverPreWrap($item))) |
|
| 94 | - ->store(); |
|
| 92 | + ->bucket($this->bucketName) |
|
| 93 | + ->newBinary($item->getKey(), $this->encode($this->driverPreWrap($item))) |
|
| 94 | + ->store(); |
|
| 95 | 95 | return true; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | $info = $this->instance->bucket($this->bucketName)->getProperties(); |
| 143 | 143 | |
| 144 | 144 | return (new DriverStatistic()) |
| 145 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 146 | - ->setRawData($info) |
|
| 147 | - ->setSize(false) |
|
| 148 | - ->setInfo('Riak does not provide size/date information att all :('); |
|
| 145 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 146 | + ->setRawData($info) |
|
| 147 | + ->setSize(false) |
|
| 148 | + ->setInfo('Riak does not provide size/date information att all :('); |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | \ No newline at end of file |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Drivers\Devnull; |
| 17 | 17 | |
@@ -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 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | * @author Lucas Brucksch <[email protected]> |
| 11 | 11 | * |
| 12 | 12 | */ |
| 13 | -declare(strict_types=1); |
|
| 13 | +declare(strict_types = 1); |
|
| 14 | 14 | |
| 15 | 15 | namespace Phpfastcache\Drivers\Zenddisk; |
| 16 | 16 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 18 | 18 | use Phpfastcache\Entities\DriverStatistic; |
| 19 | 19 | use Phpfastcache\Exceptions\{ |
| 20 | - PhpfastcacheInvalidArgumentException |
|
| 20 | + PhpfastcacheInvalidArgumentException |
|
| 21 | 21 | }; |
| 22 | 22 | use Psr\Cache\CacheItemInterface; |
| 23 | 23 | |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | { |
| 132 | 132 | $stat = new DriverStatistic(); |
| 133 | 133 | $stat->setInfo('[ZendDisk] A void info string') |
| 134 | - ->setSize(0) |
|
| 135 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 136 | - ->setRawData(false); |
|
| 134 | + ->setSize(0) |
|
| 135 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 136 | + ->setRawData(false); |
|
| 137 | 137 | |
| 138 | 138 | return $stat; |
| 139 | 139 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Util; |
| 17 | 17 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | return true; |
| 42 | 42 | } else if (\constant($CONSTANT_NAME) !== $driverName) { |
| 43 | 43 | trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours', |
| 44 | - E_USER_WARNING); |
|
| 44 | + E_USER_WARNING); |
|
| 45 | 45 | |
| 46 | 46 | return false; |
| 47 | 47 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Core\Item; |
| 17 | 17 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 19 | 19 | use Phpfastcache\EventManager; |
| 20 | 20 | use Phpfastcache\Exceptions\{ |
| 21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
| 21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
| 22 | 22 | }; |
| 23 | 23 | use Psr\Cache\CacheItemInterface; |
| 24 | 24 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | 'scheme' => 'unix', |
| 61 | 61 | 'path' => $this->config->getOption('path') |
| 62 | 62 | ]); |
| 63 | - }else{ |
|
| 63 | + } else{ |
|
| 64 | 64 | $this->instance = new PredisClient($this->getConfig()->getPredisConfigArray()); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
| 20 | 20 | use Phpfastcache\Entities\DriverStatistic; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
| 23 | 23 | }; |
| 24 | 24 | use Phpfastcache\Util\ArrayObject; |
| 25 | 25 | use Predis\Client as PredisClient; |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | if(!empty($this->config->getOption('path'))){ |
| 59 | 59 | $this->instance = new PredisClient([ |
| 60 | - 'scheme' => 'unix', |
|
| 61 | - 'path' => $this->config->getOption('path') |
|
| 60 | + 'scheme' => 'unix', |
|
| 61 | + 'path' => $this->config->getOption('path') |
|
| 62 | 62 | ]); |
| 63 | 63 | }else{ |
| 64 | 64 | $this->instance = new PredisClient($this->getConfig()->getPredisConfigArray()); |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | $date = (isset($info[ 'Server' ][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(\time() - $info[ 'Server' ][ 'uptime_in_seconds' ]) : 'unknown date'); |
| 172 | 172 | |
| 173 | 173 | return (new DriverStatistic()) |
| 174 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 175 | - ->setRawData($info) |
|
| 176 | - ->setSize((int) $size) |
|
| 177 | - ->setInfo(\sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
|
| 174 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 175 | + ->setRawData($info) |
|
| 176 | + ->setSize((int) $size) |
|
| 177 | + ->setInfo(\sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
|
| 178 | 178 | $version, $date->format(DATE_RFC2822))); |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * @author Georges.L (Geolim4) <[email protected]> |
| 13 | 13 | * |
| 14 | 14 | */ |
| 15 | -declare(strict_types=1); |
|
| 15 | +declare(strict_types = 1); |
|
| 16 | 16 | |
| 17 | 17 | namespace Phpfastcache\Drivers\Predis; |
| 18 | 18 | |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected function driverConnect(): bool |
| 57 | 57 | { |
| 58 | - if(!empty($this->config->getOption('path'))){ |
|
| 58 | + if (!empty($this->config->getOption('path'))) { |
|
| 59 | 59 | $this->instance = new PredisClient([ |
| 60 | 60 | 'scheme' => 'unix', |
| 61 | 61 | 'path' => $this->config->getOption('path') |
| 62 | 62 | ]); |
| 63 | - }else{ |
|
| 63 | + } else { |
|
| 64 | 64 | $this->instance = new PredisClient($this->getConfig()->getPredisConfigArray()); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @see https://redis.io/commands/expire |
| 107 | 107 | */ |
| 108 | 108 | if ($ttl <= 0) { |
| 109 | - return (bool)$this->instance->expire($item->getKey(), 0); |
|
| 109 | + return (bool) $this->instance->expire($item->getKey(), 0); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item)))->getPayload() === 'OK'; |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | public function getStats(): DriverStatistic |
| 167 | 167 | { |
| 168 | 168 | $info = $this->instance->info(); |
| 169 | - $size = (isset($info[ 'Memory' ][ 'used_memory' ]) ? $info[ 'Memory' ][ 'used_memory' ] : 0); |
|
| 170 | - $version = (isset($info[ 'Server' ][ 'redis_version' ]) ? $info[ 'Server' ][ 'redis_version' ] : 0); |
|
| 171 | - $date = (isset($info[ 'Server' ][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(\time() - $info[ 'Server' ][ 'uptime_in_seconds' ]) : 'unknown date'); |
|
| 169 | + $size = (isset($info['Memory']['used_memory']) ? $info['Memory']['used_memory'] : 0); |
|
| 170 | + $version = (isset($info['Server']['redis_version']) ? $info['Server']['redis_version'] : 0); |
|
| 171 | + $date = (isset($info['Server']['uptime_in_seconds']) ? (new \DateTime())->setTimestamp(\time() - $info['Server']['uptime_in_seconds']) : 'unknown date'); |
|
| 172 | 172 | |
| 173 | 173 | return (new DriverStatistic()) |
| 174 | 174 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | use Phpfastcache\Core\Item\ExtendedCacheItemInterface; |
| 20 | 20 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheDriverCheckException, PhpfastcacheInvalidArgumentException, PhpfastcacheRootException, PhpfastcacheSimpleCacheException |
|
| 22 | + PhpfastcacheDriverCheckException, PhpfastcacheInvalidArgumentException, PhpfastcacheRootException, PhpfastcacheSimpleCacheException |
|
| 23 | 23 | }; |
| 24 | 24 | use Psr\SimpleCache\CacheInterface; |
| 25 | 25 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | try { |
| 78 | 78 | $cacheItem = $this->internalCacheInstance |
| 79 | - ->getItem($key) |
|
| 80 | - ->set($value); |
|
| 79 | + ->getItem($key) |
|
| 80 | + ->set($value); |
|
| 81 | 81 | if (\is_int($ttl) && $ttl <= 0) { |
| 82 | 82 | $cacheItem->expiresAt((new \DateTime('@0'))); |
| 83 | 83 | } elseif (\is_int($ttl) || $ttl instanceof \DateInterval) { |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -declare(strict_types=1); |
|
| 14 | +declare(strict_types = 1); |
|
| 15 | 15 | |
| 16 | 16 | namespace Phpfastcache\Helper; |
| 17 | 17 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function getMultiple($keys, $default = null) |
| 126 | 126 | { |
| 127 | 127 | try { |
| 128 | - return array_map(function (ExtendedCacheItemInterface $item) { |
|
| 128 | + return array_map(function(ExtendedCacheItemInterface $item) { |
|
| 129 | 129 | return $item->get(); |
| 130 | 130 | }, $this->internalCacheInstance->getItems($keys)); |
| 131 | 131 | } catch (PhpfastcacheInvalidArgumentException $e) { |