@@ -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\service; |
14 | 14 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | Model::setDb($this->app->db); |
26 | 26 | Model::setEvent($this->app->event); |
27 | 27 | Model::setInvoker([$this->app, 'invoke']); |
28 | - Model::maker(function (Model $model) { |
|
28 | + Model::maker(function(Model $model) { |
|
29 | 29 | $config = $this->app->config; |
30 | 30 | |
31 | 31 | $isAutoWriteTimestamp = $model->getAutoWriteTimestamp(); |
@@ -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\service; |
14 | 14 | |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | |
31 | 31 | public function boot() |
32 | 32 | { |
33 | - Paginator::maker(function (...$args) { |
|
33 | + Paginator::maker(function(...$args) { |
|
34 | 34 | return $this->app->make(Paginator::class, $args, true); |
35 | 35 | }); |
36 | 36 | |
37 | - Paginator::currentPathResolver(function () { |
|
37 | + Paginator::currentPathResolver(function() { |
|
38 | 38 | return $this->app->request->baseUrl(); |
39 | 39 | }); |
40 | 40 | |
41 | - Paginator::currentPageResolver(function ($varPage = 'page') { |
|
41 | + Paginator::currentPageResolver(function($varPage = 'page') { |
|
42 | 42 | $page = $this->app->request->param($varPage); |
43 | 43 | |
44 | 44 | if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { |
@@ -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\validate; |
14 | 14 |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function init(App $app) |
32 | 32 | { |
33 | - $file = $app->getRootPath() . 'vendor/services.php'; |
|
33 | + $file = $app->getRootPath().'vendor/services.php'; |
|
34 | 34 | |
35 | 35 | $services = $this->services; |
36 | 36 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: 麦当苗儿 <[email protected]> <http://zjzit.cn> |
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: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | { |
66 | 66 | if (is_file($file)) { |
67 | 67 | $filename = $file; |
68 | - } elseif (is_file($this->path . $file . $this->ext)) { |
|
69 | - $filename = $this->path . $file . $this->ext; |
|
68 | + } elseif (is_file($this->path.$file.$this->ext)) { |
|
69 | + $filename = $this->path.$file.$this->ext; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if (isset($filename)) { |
@@ -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 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function domain(bool $port = false): string |
365 | 365 | { |
366 | - return $this->scheme() . '://' . $this->host($port); |
|
366 | + return $this->scheme().'://'.$this->host($port); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | if (!$root) { |
379 | 379 | $item = explode('.', $this->host()); |
380 | 380 | $count = count($item); |
381 | - $root = $count > 1 ? $item[$count - 2] . '.' . $item[$count - 1] : $item[0]; |
|
381 | + $root = $count > 1 ? $item[$count - 2].'.'.$item[$count - 1] : $item[0]; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | return $root; |
@@ -466,14 +466,14 @@ discard block |
||
466 | 466 | } elseif ($this->server('REQUEST_URI')) { |
467 | 467 | $url = $this->server('REQUEST_URI'); |
468 | 468 | } elseif ($this->server('ORIG_PATH_INFO')) { |
469 | - $url = $this->server('ORIG_PATH_INFO') . (!empty($this->server('QUERY_STRING')) ? '?' . $this->server('QUERY_STRING') : ''); |
|
469 | + $url = $this->server('ORIG_PATH_INFO').(!empty($this->server('QUERY_STRING')) ? '?'.$this->server('QUERY_STRING') : ''); |
|
470 | 470 | } elseif (isset($_SERVER['argv'][1])) { |
471 | 471 | $url = $_SERVER['argv'][1]; |
472 | 472 | } else { |
473 | 473 | $url = ''; |
474 | 474 | } |
475 | 475 | |
476 | - return $complete ? $this->domain() . $url : $url; |
|
476 | + return $complete ? $this->domain().$url : $url; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str; |
502 | 502 | } |
503 | 503 | |
504 | - return $complete ? $this->domain() . $this->baseUrl : $this->baseUrl; |
|
504 | + return $complete ? $this->domain().$this->baseUrl : $this->baseUrl; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | /** |
@@ -522,8 +522,8 @@ discard block |
||
522 | 522 | $url = $this->server('PHP_SELF'); |
523 | 523 | } elseif (basename($this->server('ORIG_SCRIPT_NAME')) === $script_name) { |
524 | 524 | $url = $this->server('ORIG_SCRIPT_NAME'); |
525 | - } elseif (($pos = strpos($this->server('PHP_SELF'), '/' . $script_name)) !== false) { |
|
526 | - $url = substr($this->server('SCRIPT_NAME'), 0, $pos) . '/' . $script_name; |
|
525 | + } elseif (($pos = strpos($this->server('PHP_SELF'), '/'.$script_name)) !== false) { |
|
526 | + $url = substr($this->server('SCRIPT_NAME'), 0, $pos).'/'.$script_name; |
|
527 | 527 | } elseif ($this->server('DOCUMENT_ROOT') && strpos($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT')) === 0) { |
528 | 528 | $url = str_replace('\\', '/', str_replace($this->server('DOCUMENT_ROOT'), '', $this->server('SCRIPT_FILENAME'))); |
529 | 529 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $this->baseFile = $url; |
532 | 532 | } |
533 | 533 | |
534 | - return $complete ? $this->domain() . $this->baseFile : $this->baseFile; |
|
534 | + return $complete ? $this->domain().$this->baseFile : $this->baseFile; |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | /** |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $this->root = rtrim($file, '/'); |
563 | 563 | } |
564 | 564 | |
565 | - return $complete ? $this->domain() . $this->root : $this->root; |
|
565 | + return $complete ? $this->domain().$this->root : $this->root; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | /** |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base; |
577 | 577 | |
578 | 578 | if ('' != $root) { |
579 | - $root = '/' . ltrim($root, '/'); |
|
579 | + $root = '/'.ltrim($root, '/'); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | return $root; |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | if (is_scalar($data)) { |
1318 | 1318 | $data = (string) $data; |
1319 | 1319 | } else { |
1320 | - throw new \InvalidArgumentException('variable type error:' . gettype($data)); |
|
1320 | + throw new \InvalidArgumentException('variable type error:'.gettype($data)); |
|
1321 | 1321 | } |
1322 | 1322 | break; |
1323 | 1323 | } |
@@ -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 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | foreach ($methods as $method) { |
188 | 188 | $name = $method->getName(); |
189 | 189 | if (0 === strpos($name, 'on')) { |
190 | - $this->listen($prefix . substr($name, 2), [$observer, $name]); |
|
190 | + $this->listen($prefix.substr($name, 2), [$observer, $name]); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 |