@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * @return int|bool Return size in octet or false if no information available |
|
55 | + * @return string Return size in octet or false if no information available |
|
56 | 56 | */ |
57 | 57 | public function getSize() |
58 | 58 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | - * @return mixed |
|
63 | + * @return string |
|
64 | 64 | */ |
65 | 65 | public function getData() |
66 | 66 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @param $info |
|
71 | + * @param string $info |
|
72 | 72 | * @return $this |
73 | 73 | */ |
74 | 74 | public function setInfo($info) |
@@ -334,7 +334,7 @@ |
||
334 | 334 | |
335 | 335 | /** |
336 | 336 | * @internal This method de-register an item from $this->itemInstances |
337 | - * @param CacheItemInterface|string $item |
|
337 | + * @param CacheItemInterface $item |
|
338 | 338 | * @throws \InvalidArgumentException |
339 | 339 | */ |
340 | 340 | protected function deregisterItem($item) |
@@ -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,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function detachItem(CacheItemInterface $item) |
304 | 304 | { |
305 | - if(isset($this->itemInstances[$item->getKey()])){ |
|
305 | + if (isset($this->itemInstances[$item->getKey()])) { |
|
306 | 306 | $this->deregisterItem($item); |
307 | 307 | } |
308 | 308 | } |
@@ -324,9 +324,9 @@ discard block |
||
324 | 324 | */ |
325 | 325 | public function attachItem(CacheItemInterface $item) |
326 | 326 | { |
327 | - if(isset($this->itemInstances[$item->getKey()]) && spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
327 | + if (isset($this->itemInstances[$item->getKey()]) && spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) { |
|
328 | 328 | throw new \LogicException('The item already exists and cannot be overwritten because the Spl object hash mismatches ! You probably tried to re-attach a detached item which has been already retrieved from cache.'); |
329 | - }else{ |
|
329 | + } else { |
|
330 | 330 | $this->itemInstances[$item->getKey()] = $item; |
331 | 331 | } |
332 | 332 | } |
@@ -339,15 +339,15 @@ discard block |
||
339 | 339 | */ |
340 | 340 | protected function deregisterItem($item) |
341 | 341 | { |
342 | - if($item instanceof CacheItemInterface){ |
|
343 | - unset($this->itemInstances[ $item->getKey() ]); |
|
342 | + if ($item instanceof CacheItemInterface) { |
|
343 | + unset($this->itemInstances[$item->getKey()]); |
|
344 | 344 | |
345 | - }else if(is_string($item)){ |
|
346 | - unset($this->itemInstances[ $item ]); |
|
347 | - }else{ |
|
345 | + } else if (is_string($item)) { |
|
346 | + unset($this->itemInstances[$item]); |
|
347 | + } else { |
|
348 | 348 | throw new \InvalidArgumentException('Invalid type for $item variable'); |
349 | 349 | } |
350 | - if(gc_enabled()){ |
|
350 | + if (gc_enabled()) { |
|
351 | 351 | gc_collect_cycles(); |
352 | 352 | } |
353 | 353 | } |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function isAttached(CacheItemInterface $item) |
365 | 365 | { |
366 | - if(isset($this->itemInstances[$item->getKey()])){ |
|
367 | - return spl_object_hash($item) === spl_object_hash($this->itemInstances[ $item->getKey() ]); |
|
366 | + if (isset($this->itemInstances[$item->getKey()])) { |
|
367 | + return spl_object_hash($item) === spl_object_hash($this->itemInstances[$item->getKey()]); |
|
368 | 368 | } |
369 | 369 | return null; |
370 | 370 | } |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | { |
327 | 327 | if(isset($this->itemInstances[$item->getKey()]) && spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
328 | 328 | throw new \LogicException('The item already exists and cannot be overwritten because the Spl object hash mismatches ! You probably tried to re-attach a detached item which has been already retrieved from cache.'); |
329 | - }else{ |
|
329 | + } else{ |
|
330 | 330 | $this->itemInstances[$item->getKey()] = $item; |
331 | 331 | } |
332 | 332 | } |
@@ -342,9 +342,9 @@ discard block |
||
342 | 342 | if($item instanceof CacheItemInterface){ |
343 | 343 | unset($this->itemInstances[ $item->getKey() ]); |
344 | 344 | |
345 | - }else if(is_string($item)){ |
|
345 | + } else if(is_string($item)){ |
|
346 | 346 | unset($this->itemInstances[ $item ]); |
347 | - }else{ |
|
347 | + } else{ |
|
348 | 348 | throw new \InvalidArgumentException('Invalid type for $item variable'); |
349 | 349 | } |
350 | 350 | if(gc_enabled()){ |
@@ -215,7 +215,7 @@ |
||
215 | 215 | { |
216 | 216 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
217 | 217 | $this->itemInstances[ $item->getKey() ] = $item; |
218 | - }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
218 | + } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
219 | 219 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
220 | 220 | } |
221 | 221 |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | /** |
187 | 187 | * @param \Psr\Cache\CacheItemInterface $item |
188 | - * @return mixed |
|
188 | + * @return boolean |
|
189 | 189 | * @throws \InvalidArgumentException |
190 | 190 | * @throws \RuntimeException |
191 | 191 | */ |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
231 | - * @return mixed|null |
|
231 | + * @return boolean |
|
232 | 232 | * @throws \InvalidArgumentException |
233 | 233 | */ |
234 | 234 | public function commit() |
@@ -77,9 +77,9 @@ |
||
77 | 77 | * Reset the Item |
78 | 78 | */ |
79 | 79 | $item->set(null) |
80 | - ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])) |
|
81 | - ->setHit(false) |
|
82 | - ->setTags([]); |
|
80 | + ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])) |
|
81 | + ->setHit(false) |
|
82 | + ->setTags([]); |
|
83 | 83 | } else { |
84 | 84 | $item->setHit(true); |
85 | 85 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $driverArray = $this->driverRead($item); |
58 | 58 | |
59 | 59 | if ($driverArray) { |
60 | - if(!is_array($driverArray)){ |
|
60 | + if (!is_array($driverArray)) { |
|
61 | 61 | throw new phpFastCacheCoreException(sprintf('The driverRead method returned an unexpected variable type: %s', gettype($driverArray))); |
62 | 62 | } |
63 | 63 | $item->set($this->driverUnwrapData($driverArray)); |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | * Reset the Item |
78 | 78 | */ |
79 | 79 | $item->set(null) |
80 | - ->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])) |
|
80 | + ->expiresAfter(abs((int) $this->getConfig()['defaultTtl'])) |
|
81 | 81 | ->setHit(false) |
82 | 82 | ->setTags([]); |
83 | 83 | } else { |
84 | 84 | $item->setHit(true); |
85 | 85 | } |
86 | 86 | } else { |
87 | - $item->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ])); |
|
87 | + $item->expiresAfter(abs((int) $this->getConfig()['defaultTtl'])); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.', gettype($key))); |
93 | 93 | } |
94 | 94 | |
95 | - return $this->itemInstances[ $key ]; |
|
95 | + return $this->itemInstances[$key]; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function setItem(CacheItemInterface $item) |
104 | 104 | { |
105 | 105 | if ($this->getClassNamespace() . '\\Item' === get_class($item)) { |
106 | - $this->itemInstances[ $item->getKey() ] = $item; |
|
106 | + $this->itemInstances[$item->getKey()] = $item; |
|
107 | 107 | |
108 | 108 | return $this; |
109 | 109 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $collection = []; |
122 | 122 | foreach ($keys as $key) { |
123 | - $collection[ $key ] = $this->getItem($key); |
|
123 | + $collection[$key] = $this->getItem($key); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $collection; |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | * @var ExtendedCacheItemInterface $item |
203 | 203 | */ |
204 | 204 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
205 | - $this->itemInstances[ $item->getKey() ] = $item; |
|
206 | - } else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
205 | + $this->itemInstances[$item->getKey()] = $item; |
|
206 | + } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) { |
|
207 | 207 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
208 | 208 | } |
209 | 209 | |
@@ -226,12 +226,12 @@ discard block |
||
226 | 226 | public function saveDeferred(CacheItemInterface $item) |
227 | 227 | { |
228 | 228 | if (!array_key_exists($item->getKey(), $this->itemInstances)) { |
229 | - $this->itemInstances[ $item->getKey() ] = $item; |
|
230 | - }else if(spl_object_hash($item) !== spl_object_hash($this->itemInstances[ $item->getKey() ])){ |
|
229 | + $this->itemInstances[$item->getKey()] = $item; |
|
230 | + } else if (spl_object_hash($item) !== spl_object_hash($this->itemInstances[$item->getKey()])) { |
|
231 | 231 | throw new \RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.'); |
232 | 232 | } |
233 | 233 | |
234 | - return $this->deferredList[ $item->getKey() ] = $item; |
|
234 | + return $this->deferredList[$item->getKey()] = $item; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | foreach ($this->deferredList as $key => $item) { |
245 | 245 | $result = $this->save($item); |
246 | 246 | if ($return !== false) { |
247 | - unset($this->deferredList[ $key ]); |
|
247 | + unset($this->deferredList[$key]); |
|
248 | 248 | $return = $result; |
249 | 249 | } |
250 | 250 | } |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | protected function driverRead(CacheItemInterface $item) |
80 | 80 | { |
81 | 81 | return [ |
82 | - self::DRIVER_DATA_WRAPPER_INDEX => true, |
|
83 | - self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
84 | - self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(), |
|
82 | + self::DRIVER_DATA_WRAPPER_INDEX => true, |
|
83 | + self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
84 | + self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(), |
|
85 | 85 | ]; |
86 | 86 | } |
87 | 87 | |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | { |
132 | 132 | $stat = new driverStatistic(); |
133 | 133 | $stat->setInfo('[Devtrue] A void info string') |
134 | - ->setSize(0) |
|
135 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
136 | - ->setRawData(true); |
|
134 | + ->setSize(0) |
|
135 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
136 | + ->setRawData(true); |
|
137 | 137 | |
138 | 138 | return $stat; |
139 | 139 | } |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | protected function driverRead(CacheItemInterface $item) |
80 | 80 | { |
81 | 81 | return [ |
82 | - self::DRIVER_DATA_WRAPPER_INDEX => false, |
|
83 | - self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
84 | - self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(), |
|
82 | + self::DRIVER_DATA_WRAPPER_INDEX => false, |
|
83 | + self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
84 | + self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(), |
|
85 | 85 | ]; |
86 | 86 | } |
87 | 87 | /** |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | { |
131 | 131 | $stat = new driverStatistic(); |
132 | 132 | $stat->setInfo('[Devfalse] A void info string') |
133 | - ->setSize(0) |
|
134 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
135 | - ->setRawData(false); |
|
133 | + ->setSize(0) |
|
134 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
135 | + ->setRawData(false); |
|
136 | 136 | |
137 | 137 | return $stat; |
138 | 138 | } |
@@ -46,6 +46,6 @@ |
||
46 | 46 | }); |
47 | 47 | |
48 | 48 | if ((!defined('PFC_IGNORE_COMPOSER_WARNING') || !PFC_IGNORE_COMPOSER_WARNING) && class_exists('Composer\Autoload\ClassLoader')) { |
49 | - trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.', |
|
49 | + trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.', |
|
50 | 50 | E_USER_WARNING); |
51 | 51 | } |
52 | 52 | \ No newline at end of file |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Register Autoload |
20 | 20 | */ |
21 | -spl_autoload_register(function ($entity) { |
|
21 | +spl_autoload_register(function($entity) { |
|
22 | 22 | $module = explode('\\', $entity, 2); |
23 | - if (!in_array($module[ 0 ], ['phpFastCache', 'Psr'])) { |
|
23 | + if (!in_array($module[0], ['phpFastCache', 'Psr'])) { |
|
24 | 24 | /** |
25 | 25 | * Not a part of phpFastCache file |
26 | 26 | * then we return here. |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | if (is_readable($path)) { |
33 | 33 | require_once $path; |
34 | - }else{ |
|
34 | + } else { |
|
35 | 35 | trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR); |
36 | 36 | } |
37 | 37 | return; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | if (is_readable($path)) { |
33 | 33 | require_once $path; |
34 | - }else{ |
|
34 | + } else{ |
|
35 | 35 | trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR); |
36 | 36 | } |
37 | 37 | return; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $keyword = self::PREFIX . $item->getKey(); |
81 | 81 | $v = json_encode($this->driverPreWrap($item)); |
82 | 82 | |
83 | - if (isset($this->config[ 'limited_memory_each_object' ]) && strlen($v) > $this->config[ 'limited_memory_each_object' ]) { |
|
83 | + if (isset($this->config['limited_memory_each_object']) && strlen($v) > $this->config['limited_memory_each_object']) { |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | // return null if no caching |
102 | 102 | // return value if in caching |
103 | 103 | $keyword = self::PREFIX . $item->getKey(); |
104 | - $x = isset($_COOKIE[ $keyword ]) ? json_decode($_COOKIE[ $keyword ], true) : false; |
|
104 | + $x = isset($_COOKIE[$keyword]) ? json_decode($_COOKIE[$keyword], true) : false; |
|
105 | 105 | |
106 | 106 | if ($x == false) { |
107 | 107 | return null; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $this->driverConnect(); |
124 | 124 | $keyword = self::PREFIX . $key; |
125 | - $x = isset($_COOKIE[ $keyword ]) ? $this->decode(json_decode($_COOKIE[ $keyword ])->t) : false; |
|
125 | + $x = isset($_COOKIE[$keyword]) ? $this->decode(json_decode($_COOKIE[$keyword])->t) : false; |
|
126 | 126 | |
127 | 127 | return $x ? $x - time() : $x; |
128 | 128 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if ($item instanceof Item) { |
141 | 141 | $this->driverConnect(); |
142 | 142 | $keyword = self::PREFIX . $item->getKey(); |
143 | - $_COOKIE[ $keyword ] = null; |
|
143 | + $_COOKIE[$keyword] = null; |
|
144 | 144 | |
145 | 145 | return @setcookie($keyword, null, -10); |
146 | 146 | } else { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $this->driverConnect(); |
158 | 158 | foreach ($_COOKIE as $keyword => $value) { |
159 | 159 | if (strpos($keyword, self::PREFIX) !== false) { |
160 | - $_COOKIE[ $keyword ] = null; |
|
160 | + $_COOKIE[$keyword] = null; |
|
161 | 161 | $result = @setcookie($keyword, null, -10); |
162 | 162 | if ($return !== false) { |
163 | 163 | $return = $result; |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | $config = isset($this->config[ 'predis' ]) ? $this->config[ 'predis' ] : []; |
128 | 128 | |
129 | 129 | $this->instance = new PredisClient(array_merge([ |
130 | - 'host' => '127.0.0.1', |
|
131 | - 'port' => 6379, |
|
132 | - 'password' => null, |
|
133 | - 'database' => null, |
|
130 | + 'host' => '127.0.0.1', |
|
131 | + 'port' => 6379, |
|
132 | + 'password' => null, |
|
133 | + 'database' => null, |
|
134 | 134 | ], $config)); |
135 | 135 | |
136 | 136 | return true; |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | $date = (isset($info['Server'][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info['Server'][ 'uptime_in_seconds' ]) : 'unknown date'); |
154 | 154 | |
155 | 155 | return (new driverStatistic()) |
156 | - ->setData(implode(', ', array_keys($this->itemInstances))) |
|
157 | - ->setRawData($this->instance->info()) |
|
158 | - ->setSize($size) |
|
159 | - ->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.", $version, $date->format(DATE_RFC2822))); |
|
156 | + ->setData(implode(', ', array_keys($this->itemInstances))) |
|
157 | + ->setRawData($this->instance->info()) |
|
158 | + ->setSize($size) |
|
159 | + ->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.", $version, $date->format(DATE_RFC2822))); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | \ No newline at end of file |
@@ -76,7 +76,7 @@ |
||
76 | 76 | */ |
77 | 77 | if($ttl <= 0){ |
78 | 78 | return $this->instance->expire($item->getKey(), 0); |
79 | - }else{ |
|
79 | + } else{ |
|
80 | 80 | return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item))); |
81 | 81 | } |
82 | 82 | } else { |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | * @see https://redis.io/commands/setex |
79 | 79 | * @see https://redis.io/commands/expire |
80 | 80 | */ |
81 | - if($ttl <= 0){ |
|
81 | + if ($ttl <= 0) { |
|
82 | 82 | return $this->instance->expire($item->getKey(), 0); |
83 | - }else{ |
|
83 | + } else { |
|
84 | 84 | return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item))); |
85 | 85 | } |
86 | 86 | } else { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | protected function driverConnect() |
134 | 134 | { |
135 | - $config = isset($this->config[ 'predis' ]) ? $this->config[ 'predis' ] : []; |
|
135 | + $config = isset($this->config['predis']) ? $this->config['predis'] : []; |
|
136 | 136 | |
137 | 137 | $this->instance = new PredisClient(array_merge([ |
138 | 138 | 'host' => '127.0.0.1', |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $info = $this->instance->info(); |
159 | 159 | $size = (isset($info['Memory']['used_memory']) ? $info['Memory']['used_memory'] : 0); |
160 | 160 | $version = (isset($info['Server']['redis_version']) ? $info['Server']['redis_version'] : 0); |
161 | - $date = (isset($info['Server'][ 'uptime_in_seconds' ]) ? (new \DateTime())->setTimestamp(time() - $info['Server'][ 'uptime_in_seconds' ]) : 'unknown date'); |
|
161 | + $date = (isset($info['Server']['uptime_in_seconds']) ? (new \DateTime())->setTimestamp(time() - $info['Server']['uptime_in_seconds']) : 'unknown date'); |
|
162 | 162 | |
163 | 163 | return (new driverStatistic()) |
164 | 164 | ->setData(implode(', ', array_keys($this->itemInstances))) |
@@ -130,8 +130,8 @@ |
||
130 | 130 | */ |
131 | 131 | public function getStats() |
132 | 132 | { |
133 | - if(function_exists('zend_shm_cache_info')) { |
|
134 | - $stats = (array)zend_shm_cache_info(); |
|
133 | + if (function_exists('zend_shm_cache_info')) { |
|
134 | + $stats = (array) zend_shm_cache_info(); |
|
135 | 135 | return (new driverStatistic()) |
136 | 136 | ->setData(implode(', ', array_keys($this->itemInstances))) |
137 | 137 | ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total'])) |