@@ -8,7 +8,7 @@ |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\initializer; |
14 | 14 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\initializer; |
14 | 14 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function init(App $app) |
33 | 33 | { |
34 | - $file = $app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'services.php'; |
|
34 | + $file = $app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.'services.php'; |
|
35 | 35 | |
36 | 36 | $services = $this->services; |
37 | 37 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $this->data = $data; |
388 | 388 | } |
389 | 389 | |
390 | - $sessionId = md5(microtime(true) . uniqid()); |
|
390 | + $sessionId = md5(microtime(true).uniqid()); |
|
391 | 391 | |
392 | 392 | $this->setId($sessionId); |
393 | 393 | return $sessionId; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | { |
65 | 65 | if (is_file($file)) { |
66 | 66 | $filename = $file; |
67 | - } elseif (is_file($this->path . $file . $this->ext)) { |
|
68 | - $filename = $this->path . $file . $this->ext; |
|
67 | + } elseif (is_file($this->path.$file.$this->ext)) { |
|
68 | + $filename = $this->path.$file.$this->ext; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if (isset($filename)) { |
@@ -8,7 +8,7 @@ |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\filesystem; |
14 | 14 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $stream = fopen($file->getRealPath(), 'r'); |
87 | 87 | |
88 | 88 | $result = $this->putStream( |
89 | - $path = trim($path . '/' . $name, '/'), $stream, $options |
|
89 | + $path = trim($path.'/'.$name, '/'), $stream, $options |
|
90 | 90 | ); |
91 | 91 | |
92 | 92 | if (is_resource($stream)) { |
@@ -8,7 +8,7 @@ |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\facade; |
14 | 14 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\cache; |
14 | 14 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getCacheKey(string $name): string |
83 | 83 | { |
84 | - return $this->options['prefix'] . $name; |
|
84 | + return $this->options['prefix'].$name; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | |
143 | 143 | $time = time(); |
144 | 144 | |
145 | - while ($time + 5 > time() && $this->has($name . '_lock')) { |
|
145 | + while ($time + 5 > time() && $this->has($name.'_lock')) { |
|
146 | 146 | // 存在锁定则等待 |
147 | 147 | usleep(200000); |
148 | 148 | } |
149 | 149 | |
150 | 150 | try { |
151 | 151 | // 锁定 |
152 | - $this->set($name . '_lock', true); |
|
152 | + $this->set($name.'_lock', true); |
|
153 | 153 | |
154 | 154 | if ($value instanceof \Closure) { |
155 | 155 | // 获取缓存数据 |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | $this->set($name, $value, $expire); |
161 | 161 | |
162 | 162 | // 解锁 |
163 | - $this->delete($name . '_lock'); |
|
163 | + $this->delete($name.'_lock'); |
|
164 | 164 | } catch (\Exception | \throwable $e) { |
165 | - $this->delete($name . '_lock'); |
|
165 | + $this->delete($name.'_lock'); |
|
166 | 166 | throw $e; |
167 | 167 | } |
168 | 168 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $key = implode('-', $name); |
182 | 182 | |
183 | 183 | if (!isset($this->tag[$key])) { |
184 | - $name = array_map(function ($val) { |
|
184 | + $name = array_map(function($val) { |
|
185 | 185 | return $this->getTagKey($val); |
186 | 186 | }, $name); |
187 | 187 | $this->tag[$key] = new TagSet($name, $this); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function getTagKey(string $tag): string |
212 | 212 | { |
213 | - return $this->options['tag_prefix'] . md5($tag); |
|
213 | + return $this->options['tag_prefix'].md5($tag); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $this->handler = new \Redis; |
56 | 56 | |
57 | 57 | if ($this->options['persistent']) { |
58 | - $this->handler->pconnect($this->options['host'], (int) $this->options['port'], $this->options['timeout'], 'persistent_id_' . $this->options['select']); |
|
58 | + $this->handler->pconnect($this->options['host'], (int) $this->options['port'], $this->options['timeout'], 'persistent_id_'.$this->options['select']); |
|
59 | 59 | } else { |
60 | 60 | $this->handler->connect($this->options['host'], (int) $this->options['port'], $this->options['timeout']); |
61 | 61 | } |