@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $default = $this->getDefault(); |
| 42 | 42 | $regex = $this->trueAnswerRegex; |
| 43 | 43 | |
| 44 | - return function ($answer) use ($default, $regex) { |
|
| 44 | + return function($answer) use ($default, $regex) { |
|
| 45 | 45 | if (is_bool($answer)) { |
| 46 | 46 | return $answer; |
| 47 | 47 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | $multiselect = $this->multiselect; |
| 109 | 109 | $isAssoc = $this->isAssoc($choices); |
| 110 | 110 | |
| 111 | - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { |
|
| 111 | + return function($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { |
|
| 112 | 112 | // Collapse all spaces. |
| 113 | 113 | $selectedChoices = str_replace(' ', '', $selected); |
| 114 | 114 | |
@@ -8,7 +8,7 @@ |
||
| 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\driver; |
| 14 | 14 | |
@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | foreach ($hosts as $i => $host) { |
| 57 | 57 | $port = $ports[$i] ?? $ports[0]; |
| 58 | 58 | $this->options['timeout'] > 0 ? |
| 59 | - $this->handler->addServer($host, $port, $this->options['persistent'], 1, $this->options['timeout']) : |
|
| 60 | - $this->handler->addServer($host, $port, $this->options['persistent'], 1); |
|
| 59 | + $this->handler->addServer($host, $port, $this->options['persistent'], 1, $this->options['timeout']) : $this->handler->addServer($host, $port, $this->options['persistent'], 1); |
|
| 61 | 60 | } |
| 62 | 61 | } |
| 63 | 62 | |
@@ -174,8 +173,7 @@ discard block |
||
| 174 | 173 | $key = $this->getCacheKey($name); |
| 175 | 174 | |
| 176 | 175 | return false === $ttl ? |
| 177 | - $this->handler->delete($key) : |
|
| 178 | - $this->handler->delete($key, $ttl); |
|
| 176 | + $this->handler->delete($key) : $this->handler->delete($key, $ttl); |
|
| 179 | 177 | } |
| 180 | 178 | |
| 181 | 179 | /** |
@@ -188,8 +188,7 @@ |
||
| 188 | 188 | $key = $this->getCacheKey($name); |
| 189 | 189 | |
| 190 | 190 | return false === $ttl ? |
| 191 | - $this->handler->delete($key) : |
|
| 192 | - $this->handler->delete($key, $ttl); |
|
| 191 | + $this->handler->delete($key) : $this->handler->delete($key, $ttl); |
|
| 193 | 192 | } |
| 194 | 193 | |
| 195 | 194 | /** |
@@ -8,7 +8,7 @@ |
||
| 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 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | // +---------------------------------------------------------------------- |
| 9 | 9 | // | Author: zhangyajun <[email protected]> |
| 10 | 10 | // +---------------------------------------------------------------------- |
| 11 | -declare (strict_types = 1); |
|
| 11 | +declare(strict_types=1); |
|
| 12 | 12 | |
| 13 | 13 | namespace think; |
| 14 | 14 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function toArray(): array |
| 50 | 50 | { |
| 51 | - return array_map(function ($value) { |
|
| 51 | + return array_map(function($value) { |
|
| 52 | 52 | return ($value instanceof Model || $value instanceof self) ? $value->toArray() : $value; |
| 53 | 53 | }, $this->items); |
| 54 | 54 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | $operator = '='; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - return $this->filter(function ($data) use ($field, $operator, $value) { |
|
| 338 | + return $this->filter(function($data) use ($field, $operator, $value) { |
|
| 339 | 339 | if (strpos($field, '.')) { |
| 340 | 340 | list($field, $relation) = explode('.', $field); |
| 341 | 341 | |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | { |
| 478 | 478 | $items = $this->items; |
| 479 | 479 | |
| 480 | - $callback = $callback ?: function ($a, $b) { |
|
| 480 | + $callback = $callback ?: function($a, $b) { |
|
| 481 | 481 | return $a == $b ? 0 : (($a < $b) ? -1 : 1); |
| 482 | 482 | |
| 483 | 483 | }; |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | */ |
| 497 | 497 | public function order(string $field, string $order = null) |
| 498 | 498 | { |
| 499 | - return $this->sort(function ($a, $b) use ($field, $order) { |
|
| 499 | + return $this->sort(function($a, $b) use ($field, $order) { |
|
| 500 | 500 | $fieldA = $a[$field] ?? null; |
| 501 | 501 | $fieldB = $b[$field] ?? null; |
| 502 | 502 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | // +---------------------------------------------------------------------- |
| 9 | 9 | // | Author: Slince <[email protected]> |
| 10 | 10 | // +---------------------------------------------------------------------- |
| 11 | -declare (strict_types = 1); |
|
| 11 | +declare(strict_types=1); |
|
| 12 | 12 | |
| 13 | 13 | namespace think; |
| 14 | 14 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | protected function resolve(string $type = 'route') |
| 172 | 172 | { |
| 173 | - return function (Request $request) use ($type) { |
|
| 173 | + return function(Request $request) use ($type) { |
|
| 174 | 174 | $middleware = array_shift($this->queue[$type]); |
| 175 | 175 | |
| 176 | 176 | if (null === $middleware) { |
@@ -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 | |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | $data = $exception->getResponse(); |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | - $this->middleware->add(function (Request $request, $next) use ($dispatch, $data) { |
|
| 762 | + $this->middleware->add(function(Request $request, $next) use ($dispatch, $data) { |
|
| 763 | 763 | return is_null($data) ? $dispatch->run() : $data; |
| 764 | 764 | }); |
| 765 | 765 | |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | public static function parseName(string $name = null, int $type = 0, bool $ucfirst = true): string |
| 919 | 919 | { |
| 920 | 920 | if ($type) { |
| 921 | - $name = preg_replace_callback('/_([a-zA-Z])/', function ($match) { |
|
| 921 | + $name = preg_replace_callback('/_([a-zA-Z])/', function($match) { |
|
| 922 | 922 | return strtoupper($match[1]); |
| 923 | 923 | }, $name); |
| 924 | 924 | return $ucfirst ? ucfirst($name) : lcfirst($name); |