@@ -18,7 +18,7 @@ |
||
18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->driverConnect(); |
61 | 61 | $keyword = self::PREFIX . $item->getKey(); |
62 | - $x = isset($_COOKIE[ $keyword ]) ? \json_decode($_COOKIE[ $keyword ], true) : false; |
|
62 | + $x = isset($_COOKIE[$keyword]) ? \json_decode($_COOKIE[$keyword], true) : false; |
|
63 | 63 | |
64 | 64 | if ($x == false) { |
65 | 65 | return null; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $this->driverConnect(); |
106 | 106 | $keyword = self::PREFIX . $key; |
107 | - $x = isset($_COOKIE[ $keyword ]) ? $this->decode(\json_decode($_COOKIE[ $keyword ])->t) : 0; |
|
107 | + $x = isset($_COOKIE[$keyword]) ? $this->decode(\json_decode($_COOKIE[$keyword])->t) : 0; |
|
108 | 108 | |
109 | 109 | return $x ? $x - \time() : $x; |
110 | 110 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if ($item instanceof Item) { |
123 | 123 | $this->driverConnect(); |
124 | 124 | $keyword = self::PREFIX . $item->getKey(); |
125 | - $_COOKIE[ $keyword ] = null; |
|
125 | + $_COOKIE[$keyword] = null; |
|
126 | 126 | |
127 | 127 | return @setcookie($keyword, null, -10); |
128 | 128 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->driverConnect(); |
140 | 140 | foreach ($_COOKIE as $keyword => $value) { |
141 | 141 | if (\strpos($keyword, self::PREFIX) !== false) { |
142 | - $_COOKIE[ $keyword ] = null; |
|
142 | + $_COOKIE[$keyword] = null; |
|
143 | 143 | $result = @setcookie($keyword, null, -10); |
144 | 144 | if ($return !== false) { |
145 | 145 | $return = $result; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Cookie\Driver as CookieDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException |
|
22 | + PhpfastcacheInvalidArgumentException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Mongodb\Driver as MongodbDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -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 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Riak\Driver as RiakDriver; |
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\Memcached\Driver as MemcachedDriver; |
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 | |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | $date = (new \DateTime())->setTimestamp(\time() - $info[ 'total_cache_uptime' ]); |
122 | 122 | |
123 | 123 | return (new DriverStatistic()) |
124 | - ->setInfo(\sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822))) |
|
125 | - ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ]) |
|
126 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
127 | - ->setRawData($memInfo); |
|
124 | + ->setInfo(\sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822))) |
|
125 | + ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ]) |
|
126 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
127 | + ->setRawData($memInfo); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | \ No newline at end of file |
@@ -118,11 +118,11 @@ |
||
118 | 118 | { |
119 | 119 | $memInfo = wincache_ucache_meminfo(); |
120 | 120 | $info = wincache_ucache_info(); |
121 | - $date = (new \DateTime())->setTimestamp(\time() - $info[ 'total_cache_uptime' ]); |
|
121 | + $date = (new \DateTime())->setTimestamp(\time() - $info['total_cache_uptime']); |
|
122 | 122 | |
123 | 123 | return (new DriverStatistic()) |
124 | 124 | ->setInfo(\sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822))) |
125 | - ->setSize($memInfo[ 'memory_free' ] - $memInfo[ 'memory_total' ]) |
|
125 | + ->setSize($memInfo['memory_free'] - $memInfo['memory_total']) |
|
126 | 126 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
127 | 127 | ->setRawData($memInfo); |
128 | 128 | } |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | |
18 | 18 | use Phpfastcache\Config\ConfigurationOption; |
19 | 19 | use Phpfastcache\Core\Pool\{ |
20 | - DriverBaseTrait, ExtendedCacheItemPoolInterface |
|
20 | + DriverBaseTrait, ExtendedCacheItemPoolInterface |
|
21 | 21 | }; |
22 | 22 | use Phpfastcache\Entities\DriverStatistic; |
23 | 23 | use Phpfastcache\Exceptions\{ |
24 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
24 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
25 | 25 | }; |
26 | 26 | use Phpfastcache\Util\ArrayObject; |
27 | 27 | use Psr\Cache\CacheItemInterface; |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | $date = (new \DateTime())->setTimestamp(\time() - $info[ 'uptime_in_seconds' ]); |
163 | 163 | |
164 | 164 | return (new DriverStatistic()) |
165 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
166 | - ->setRawData($info) |
|
167 | - ->setSize((int)$info[ 'used_memory' ]) |
|
168 | - ->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.", |
|
165 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
166 | + ->setRawData($info) |
|
167 | + ->setSize((int)$info[ 'used_memory' ]) |
|
168 | + ->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.", |
|
169 | 169 | $info[ 'redis_version' ], $date->format(DATE_RFC2822))); |
170 | 170 | } |
171 | 171 | } |
172 | 172 | \ No newline at end of file |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * In case of an user-provided |
60 | 60 | * Redis client just return here |
61 | 61 | */ |
62 | - if($this->getConfig()->getRedisClient() instanceof RedisClient){ |
|
62 | + if ($this->getConfig()->getRedisClient() instanceof RedisClient) { |
|
63 | 63 | /** |
64 | 64 | * Unlike Predis, we can't test if we're are connected |
65 | 65 | * or not, so let's just assume that we are |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * Check for Cross-Driver type confusion |
148 | 148 | */ |
149 | 149 | if ($item instanceof Item) { |
150 | - return (bool)$this->instance->del($item->getKey()); |
|
150 | + return (bool) $this->instance->del($item->getKey()); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -174,13 +174,13 @@ discard block |
||
174 | 174 | { |
175 | 175 | // used_memory |
176 | 176 | $info = $this->instance->info(); |
177 | - $date = (new \DateTime())->setTimestamp(\time() - $info[ 'uptime_in_seconds' ]); |
|
177 | + $date = (new \DateTime())->setTimestamp(\time() - $info['uptime_in_seconds']); |
|
178 | 178 | |
179 | 179 | return (new DriverStatistic()) |
180 | 180 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
181 | 181 | ->setRawData($info) |
182 | - ->setSize((int)$info[ 'used_memory' ]) |
|
182 | + ->setSize((int) $info['used_memory']) |
|
183 | 183 | ->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.", |
184 | - $info[ 'redis_version' ], $date->format(DATE_RFC2822))); |
|
184 | + $info['redis_version'], $date->format(DATE_RFC2822))); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | \ No newline at end of file |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | $this->printSkipText('A driver could not be initialized due to missing requirement: ' . $exception->getMessage()); |
222 | 222 | } else { |
223 | 223 | $this->printFailText(\sprintf( |
224 | - 'Uncaught exception "%s" in "%s" line %d with message: "%s"', |
|
225 | - \get_class($exception), |
|
226 | - $exception->getFile(), |
|
227 | - $exception->getLine(), |
|
228 | - $exception->getMessage() |
|
224 | + 'Uncaught exception "%s" in "%s" line %d with message: "%s"', |
|
225 | + \get_class($exception), |
|
226 | + $exception->getFile(), |
|
227 | + $exception->getLine(), |
|
228 | + $exception->getMessage() |
|
229 | 229 | )); |
230 | 230 | } |
231 | 231 | $this->terminateTest(); |
@@ -272,17 +272,17 @@ discard block |
||
272 | 272 | |
273 | 273 | if ($errorType === '[FATAL ERROR]') { |
274 | 274 | $this->printFailText(\sprintf( |
275 | - "A critical error has been caught: \"%s\" in %s line %d", |
|
276 | - "$errorType $errstr", |
|
277 | - $errfile, |
|
278 | - $errline |
|
275 | + "A critical error has been caught: \"%s\" in %s line %d", |
|
276 | + "$errorType $errstr", |
|
277 | + $errfile, |
|
278 | + $errline |
|
279 | 279 | )); |
280 | 280 | } else { |
281 | 281 | $this->printDebugText(\sprintf( |
282 | - "A non-critical error has been caught: \"%s\" in %s line %d", |
|
283 | - "$errorType $errstr", |
|
284 | - $errfile, |
|
285 | - $errline |
|
282 | + "A non-critical error has been caught: \"%s\" in %s line %d", |
|
283 | + "$errorType $errstr", |
|
284 | + $errfile, |
|
285 | + $errline |
|
286 | 286 | )); |
287 | 287 | } |
288 | 288 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function printHeaders() |
69 | 69 | { |
70 | - if(!$this->isCli() && !\headers_sent()){ |
|
70 | + if (!$this->isCli() && !\headers_sent()) { |
|
71 | 71 | \header('Content-Type: text/plain, true'); |
72 | 72 | } |
73 | 73 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | return true; |
344 | 344 | } |
345 | 345 | |
346 | - if (empty($_SERVER[ 'REMOTE_ADDR' ]) && !isset($_SERVER[ 'HTTP_USER_AGENT' ]) && \count($_SERVER[ 'argv' ]) > 0) { |
|
346 | + if (empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && \count($_SERVER['argv']) > 0) { |
|
347 | 347 | return true; |
348 | 348 | } |
349 | 349 |