Completed
Pull Request — 6.0 (#1937)
by nhzex
05:59
created
src/think/Request.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
      */
385 385
     public function domain(bool $port = false): string
386 386
     {
387
-        return $this->scheme() . '://' . $this->host($port);
387
+        return $this->scheme().'://'.$this->host($port);
388 388
     }
389 389
 
390 390
     /**
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
         if (!$root) {
400 400
             $item  = explode('.', $this->host());
401 401
             $count = count($item);
402
-            $root  = $count > 1 ? $item[$count - 2] . '.' . $item[$count - 1] : $item[0];
402
+            $root  = $count > 1 ? $item[$count - 2].'.'.$item[$count - 1] : $item[0];
403 403
         }
404 404
 
405 405
         return $root;
@@ -487,14 +487,14 @@  discard block
 block discarded – undo
487 487
         } elseif ($this->server('REQUEST_URI')) {
488 488
             $url = $this->server('REQUEST_URI');
489 489
         } elseif ($this->server('ORIG_PATH_INFO')) {
490
-            $url = $this->server('ORIG_PATH_INFO') . (!empty($this->server('QUERY_STRING')) ? '?' . $this->server('QUERY_STRING') : '');
490
+            $url = $this->server('ORIG_PATH_INFO').(!empty($this->server('QUERY_STRING')) ? '?'.$this->server('QUERY_STRING') : '');
491 491
         } elseif (isset($_SERVER['argv'][1])) {
492 492
             $url = $_SERVER['argv'][1];
493 493
         } else {
494 494
             $url = '';
495 495
         }
496 496
 
497
-        return $complete ? $this->domain() . $url : $url;
497
+        return $complete ? $this->domain().$url : $url;
498 498
     }
499 499
 
500 500
     /**
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
             $this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str;
523 523
         }
524 524
 
525
-        return $complete ? $this->domain() . $this->baseUrl : $this->baseUrl;
525
+        return $complete ? $this->domain().$this->baseUrl : $this->baseUrl;
526 526
     }
527 527
 
528 528
     /**
@@ -543,8 +543,8 @@  discard block
 block discarded – undo
543 543
                     $url = $this->server('PHP_SELF');
544 544
                 } elseif (basename($this->server('ORIG_SCRIPT_NAME')) === $script_name) {
545 545
                     $url = $this->server('ORIG_SCRIPT_NAME');
546
-                } elseif (($pos = strpos($this->server('PHP_SELF'), '/' . $script_name)) !== false) {
547
-                    $url = substr($this->server('SCRIPT_NAME'), 0, $pos) . '/' . $script_name;
546
+                } elseif (($pos = strpos($this->server('PHP_SELF'), '/'.$script_name)) !== false) {
547
+                    $url = substr($this->server('SCRIPT_NAME'), 0, $pos).'/'.$script_name;
548 548
                 } elseif ($this->server('DOCUMENT_ROOT') && strpos($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT')) === 0) {
549 549
                     $url = str_replace('\\', '/', str_replace($this->server('DOCUMENT_ROOT'), '', $this->server('SCRIPT_FILENAME')));
550 550
                 }
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             $this->baseFile = $url;
553 553
         }
554 554
 
555
-        return $complete ? $this->domain() . $this->baseFile : $this->baseFile;
555
+        return $complete ? $this->domain().$this->baseFile : $this->baseFile;
556 556
     }
557 557
 
558 558
     /**
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
             $this->root = rtrim($file, '/');
584 584
         }
585 585
 
586
-        return $complete ? $this->domain() . $this->root : $this->root;
586
+        return $complete ? $this->domain().$this->root : $this->root;
587 587
     }
588 588
 
589 589
     /**
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
         $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base;
598 598
 
599 599
         if ('' != $root) {
600
-            $root = '/' . ltrim($root, '/');
600
+            $root = '/'.ltrim($root, '/');
601 601
         }
602 602
 
603 603
         return $root;
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
                 if (is_scalar($data)) {
1335 1335
                     $data = (string) $data;
1336 1336
                 } else {
1337
-                    throw new \InvalidArgumentException('variable type error:' . gettype($data));
1337
+                    throw new \InvalidArgumentException('variable type error:'.gettype($data));
1338 1338
                 }
1339 1339
                 break;
1340 1340
         }
Please login to merge, or discard this patch.
src/think/Response.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public static function create($data = '', string $type = '', int $code = 200): Response
103 103
     {
104
-        $class = false !== strpos($type, '\\') ? $type : '\\think\\response\\' . ucfirst(strtolower($type));
104
+        $class = false !== strpos($type, '\\') ? $type : '\\think\\response\\'.ucfirst(strtolower($type));
105 105
 
106 106
         if (class_exists($class)) {
107 107
             return Container::getInstance()->invokeClass($class, [$data, $code]);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             http_response_code($this->code);
151 151
             // 发送头部信息
152 152
             foreach ($this->header as $name => $val) {
153
-                header($name . (!is_null($val) ? ':' . $val : ''));
153
+                header($name.(!is_null($val) ? ':'.$val : ''));
154 154
             }
155 155
         }
156 156
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
      */
344 344
     public function contentType(string $contentType, string $charset = 'utf-8')
345 345
     {
346
-        $this->header['Content-Type'] = $contentType . '; charset=' . $charset;
346
+        $this->header['Content-Type'] = $contentType.'; charset='.$charset;
347 347
 
348 348
         return $this;
349 349
     }
Please login to merge, or discard this patch.
src/think/initializer/Error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/think/initializer/BootService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/think/Session.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/think/Config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
src/think/filesystem/CacheStore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/think/facade/Console.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/think/cache/TagSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.