@@ -102,7 +102,7 @@ |
||
| 102 | 102 | |
| 103 | 103 | // @TODO - Temporary fix @see https://github.com/krakjoe/apcu/pull/42 |
| 104 | 104 | if (PHP_VERSION_ID >= 50500) { |
| 105 | - $info['num_hits'] = isset($info['num_hits']) ? $info['num_hits'] : $info['nhits']; |
|
| 105 | + $info['num_hits'] = isset($info['num_hits']) ? $info['num_hits'] : $info['nhits']; |
|
| 106 | 106 | $info['num_misses'] = isset($info['num_misses']) ? $info['num_misses'] : $info['nmisses']; |
| 107 | 107 | $info['start_time'] = isset($info['start_time']) ? $info['start_time'] : $info['stime']; |
| 108 | 108 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // No lifetime, use MSET |
| 73 | - $response = $this->client->mset(array_map(function ($value) { |
|
| 73 | + $response = $this->client->mset(array_map(function($value) { |
|
| 74 | 74 | return serialize($value); |
| 75 | 75 | }, $keysAndValues)); |
| 76 | 76 | |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | $stats = $this->couchbase->getStats(); |
| 109 | 109 | $servers = $this->couchbase->getServers(); |
| 110 | 110 | $server = explode(":", $servers[0]); |
| 111 | - $key = $server[0] . ":" . "11210"; |
|
| 111 | + $key = $server[0].":"."11210"; |
|
| 112 | 112 | $stats = $stats[$key]; |
| 113 | 113 | return [ |
| 114 | 114 | Cache::STATS_HITS => $stats['get_hits'], |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | { |
| 143 | 143 | $stats = $this->memcached->getStats(); |
| 144 | 144 | $servers = $this->memcached->getServerList(); |
| 145 | - $key = $servers[0]['host'] . ':' . $servers[0]['port']; |
|
| 145 | + $key = $servers[0]['host'].':'.$servers[0]['port']; |
|
| 146 | 146 | $stats = $stats[$key]; |
| 147 | 147 | return [ |
| 148 | 148 | Cache::STATS_HITS => $stats['get_hits'], |
@@ -158,7 +158,7 @@ |
||
| 158 | 158 | /** |
| 159 | 159 | * Find a single row by ID. |
| 160 | 160 | * |
| 161 | - * @param mixed $id |
|
| 161 | + * @param string $id |
|
| 162 | 162 | * @param bool $includeData |
| 163 | 163 | * |
| 164 | 164 | * @return array|null |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * |
| 164 | 164 | * @return array|null |
| 165 | 165 | */ |
| 166 | - private function findById($id, bool $includeData = true) : ?array |
|
| 166 | + private function findById($id, bool $includeData = true) : ? array |
|
| 167 | 167 | { |
| 168 | 168 | list($idField) = $fields = $this->getFields(); |
| 169 | 169 | |
@@ -106,6 +106,6 @@ |
||
| 106 | 106 | $data = serialize($data); |
| 107 | 107 | $filename = $this->getFilename($id); |
| 108 | 108 | |
| 109 | - return $this->writeFile($filename, $lifeTime . PHP_EOL . $data); |
|
| 109 | + return $this->writeFile($filename, $lifeTime.PHP_EOL.$data); |
|
| 110 | 110 | } |
| 111 | 111 | } |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259. |
| 144 | 144 | // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents |
| 145 | 145 | // collisions between the hash and bin2hex. |
| 146 | - $filename = '_' . $hash; |
|
| 146 | + $filename = '_'.$hash; |
|
| 147 | 147 | } else { |
| 148 | 148 | $filename = bin2hex($id); |
| 149 | 149 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | parent::__construct($directory, $extension, $umask); |
| 45 | 45 | |
| 46 | - self::$emptyErrorHandler = function () { |
|
| 46 | + self::$emptyErrorHandler = function() { |
|
| 47 | 47 | }; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @return array|null |
| 113 | 113 | */ |
| 114 | - private function includeFileForId(string $id) : ?array |
|
| 114 | + private function includeFileForId(string $id) : ? array |
|
| 115 | 115 | { |
| 116 | 116 | $fileName = $this->getFilename($id); |
| 117 | 117 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->collection->updateOne( |
| 121 | 121 | ['_id' => $id], |
| 122 | 122 | ['$set' => [ |
| 123 | - MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000): null), |
|
| 123 | + MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000) : null), |
|
| 124 | 124 | MongoDBCache::DATA_FIELD => new Binary(serialize($data), Binary::TYPE_GENERIC), |
| 125 | 125 | ]], |
| 126 | 126 | ['upsert' => true] |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | 'recordStats' => 0, |
| 178 | 178 | 'repl' => 0, |
| 179 | 179 | ])->toArray()[0]; |
| 180 | - $uptime = $serverStatus['uptime'] ?? null; |
|
| 180 | + $uptime = $serverStatus['uptime'] ?? null; |
|
| 181 | 181 | } catch (Exception $e) { |
| 182 | 182 | } |
| 183 | 183 | |