@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function doFetch($id) |
67 | 67 | { |
68 | - if (! $this->doContains($id)) { |
|
68 | + if ( ! $this->doContains($id)) { |
|
69 | 69 | $this->missesCount += 1; |
70 | 70 | |
71 | 71 | return false; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | protected function doContains($id) |
83 | 83 | { |
84 | - if (! isset($this->data[$id])) { |
|
84 | + if ( ! isset($this->data[$id])) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 |
@@ -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 |
@@ -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'], |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Common\Cache; |
6 | 6 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | |
77 | 77 | // Keys have lifetime, use SETEX for each of them |
78 | 78 | foreach ($keysAndValues as $key => $value) { |
79 | - if (! $this->redis->setex($key, $lifetime, $value)) { |
|
79 | + if ( ! $this->redis->setex($key, $lifetime, $value)) { |
|
80 | 80 | $success = false; |
81 | 81 | } |
82 | 82 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $item = $this->findById($id); |
80 | 80 | |
81 | - if (! $item) { |
|
81 | + if ( ! $item) { |
|
82 | 82 | return false; |
83 | 83 | } |
84 | 84 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | { |
157 | 157 | list($idField) = $fields = $this->getFields(); |
158 | 158 | |
159 | - if (! $includeData) { |
|
159 | + if ( ! $includeData) { |
|
160 | 160 | $key = array_search(static::DATA_FIELD, $fields); |
161 | 161 | unset($fields[$key]); |
162 | 162 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public function __construct($directory, $extension = '', $umask = 0002) |
71 | 71 | { |
72 | 72 | // YES, this needs to be *before* createPathIfNeeded() |
73 | - if (! is_int($umask)) { |
|
73 | + if ( ! is_int($umask)) { |
|
74 | 74 | throw new \InvalidArgumentException(sprintf( |
75 | 75 | 'The umask parameter is required to be integer, was: %s', |
76 | 76 | gettype($umask) |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | } |
79 | 79 | $this->umask = $umask; |
80 | 80 | |
81 | - if (! $this->createPathIfNeeded($directory)) { |
|
81 | + if ( ! $this->createPathIfNeeded($directory)) { |
|
82 | 82 | throw new \InvalidArgumentException(sprintf( |
83 | 83 | 'The directory "%s" does not exist and could not be created.', |
84 | 84 | $directory |
85 | 85 | )); |
86 | 86 | } |
87 | 87 | |
88 | - if (! is_writable($directory)) { |
|
88 | + if ( ! is_writable($directory)) { |
|
89 | 89 | throw new \InvalidArgumentException(sprintf( |
90 | 90 | 'The directory "%s" is not writable.', |
91 | 91 | $directory |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259. |
141 | 141 | // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents |
142 | 142 | // collisions between the hash and bin2hex. |
143 | - $filename = '_' . $hash; |
|
143 | + $filename = '_'.$hash; |
|
144 | 144 | } else { |
145 | 145 | $filename = bin2hex($id); |
146 | 146 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | { |
192 | 192 | $usage = 0; |
193 | 193 | foreach ($this->getIterator() as $name => $file) { |
194 | - if (! $file->isDir() && $this->isFilenameEndingWithExtension($name)) { |
|
194 | + if ( ! $file->isDir() && $this->isFilenameEndingWithExtension($name)) { |
|
195 | 195 | $usage += $file->getSize(); |
196 | 196 | } |
197 | 197 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | private function createPathIfNeeded(string $path) : bool |
216 | 216 | { |
217 | - if (! is_dir($path)) { |
|
217 | + if ( ! is_dir($path)) { |
|
218 | 218 | if (@mkdir($path, 0777 & (~$this->umask), true) === false && ! is_dir($path)) { |
219 | 219 | return false; |
220 | 220 | } |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | { |
236 | 236 | $filepath = pathinfo($filename, PATHINFO_DIRNAME); |
237 | 237 | |
238 | - if (! $this->createPathIfNeeded($filepath)) { |
|
238 | + if ( ! $this->createPathIfNeeded($filepath)) { |
|
239 | 239 | return false; |
240 | 240 | } |
241 | 241 | |
242 | - if (! is_writable($filepath)) { |
|
242 | + if ( ! is_writable($filepath)) { |
|
243 | 243 | return false; |
244 | 244 | } |
245 | 245 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | { |
34 | 34 | parent::__construct($directory, $extension, $umask); |
35 | 35 | |
36 | - self::$emptyErrorHandler = function () { |
|
36 | + self::$emptyErrorHandler = function() { |
|
37 | 37 | }; |
38 | 38 | } |
39 | 39 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | restore_error_handler(); |
113 | 113 | |
114 | - if (! isset($value['lifetime'])) { |
|
114 | + if ( ! isset($value['lifetime'])) { |
|
115 | 115 | return null; |
116 | 116 | } |
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 | namespace Doctrine\Common\Cache; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ['_id' => $id], |
101 | 101 | [ |
102 | 102 | '$set' => [ |
103 | - MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000): null), |
|
103 | + MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000) : null), |
|
104 | 104 | MongoDBCache::DATA_FIELD => new Binary(serialize($data), Binary::TYPE_GENERIC), |
105 | 105 | ], |
106 | 106 | ], |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'recordStats' => 0, |
159 | 159 | 'repl' => 0, |
160 | 160 | ])->toArray()[0]; |
161 | - $uptime = $serverStatus['uptime'] ?? null; |
|
161 | + $uptime = $serverStatus['uptime'] ?? null; |
|
162 | 162 | } catch (Exception $e) { |
163 | 163 | } |
164 | 164 |