@@ -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 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | */ |
379 | 379 | public function domain(bool $port = false): string |
380 | 380 | { |
381 | - return $this->scheme() . '://' . $this->host($port); |
|
381 | + return $this->scheme().'://'.$this->host($port); |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | /** |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | if (!$root) { |
394 | 394 | $item = explode('.', $this->host()); |
395 | 395 | $count = count($item); |
396 | - $root = $count > 1 ? $item[$count - 2] . '.' . $item[$count - 1] : $item[0]; |
|
396 | + $root = $count > 1 ? $item[$count - 2].'.'.$item[$count - 1] : $item[0]; |
|
397 | 397 | } |
398 | 398 | |
399 | 399 | return $root; |
@@ -481,14 +481,14 @@ discard block |
||
481 | 481 | } elseif ($this->server('REQUEST_URI')) { |
482 | 482 | $url = $this->server('REQUEST_URI'); |
483 | 483 | } elseif ($this->server('ORIG_PATH_INFO')) { |
484 | - $url = $this->server('ORIG_PATH_INFO') . (!empty($this->server('QUERY_STRING')) ? '?' . $this->server('QUERY_STRING') : ''); |
|
484 | + $url = $this->server('ORIG_PATH_INFO').(!empty($this->server('QUERY_STRING')) ? '?'.$this->server('QUERY_STRING') : ''); |
|
485 | 485 | } elseif (isset($_SERVER['argv'][1])) { |
486 | 486 | $url = $_SERVER['argv'][1]; |
487 | 487 | } else { |
488 | 488 | $url = ''; |
489 | 489 | } |
490 | 490 | |
491 | - return $complete ? $this->domain() . $url : $url; |
|
491 | + return $complete ? $this->domain().$url : $url; |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | /** |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | $this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str; |
517 | 517 | } |
518 | 518 | |
519 | - return $complete ? $this->domain() . $this->baseUrl : $this->baseUrl; |
|
519 | + return $complete ? $this->domain().$this->baseUrl : $this->baseUrl; |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | /** |
@@ -537,8 +537,8 @@ discard block |
||
537 | 537 | $url = $this->server('PHP_SELF'); |
538 | 538 | } elseif (basename($this->server('ORIG_SCRIPT_NAME')) === $script_name) { |
539 | 539 | $url = $this->server('ORIG_SCRIPT_NAME'); |
540 | - } elseif (($pos = strpos($this->server('PHP_SELF'), '/' . $script_name)) !== false) { |
|
541 | - $url = substr($this->server('SCRIPT_NAME'), 0, $pos) . '/' . $script_name; |
|
540 | + } elseif (($pos = strpos($this->server('PHP_SELF'), '/'.$script_name)) !== false) { |
|
541 | + $url = substr($this->server('SCRIPT_NAME'), 0, $pos).'/'.$script_name; |
|
542 | 542 | } elseif ($this->server('DOCUMENT_ROOT') && strpos($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT')) === 0) { |
543 | 543 | $url = str_replace('\\', '/', str_replace($this->server('DOCUMENT_ROOT'), '', $this->server('SCRIPT_FILENAME'))); |
544 | 544 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $this->baseFile = $url; |
547 | 547 | } |
548 | 548 | |
549 | - return $complete ? $this->domain() . $this->baseFile : $this->baseFile; |
|
549 | + return $complete ? $this->domain().$this->baseFile : $this->baseFile; |
|
550 | 550 | } |
551 | 551 | |
552 | 552 | /** |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | $this->root = rtrim($file, '/'); |
578 | 578 | } |
579 | 579 | |
580 | - return $complete ? $this->domain() . $this->root : $this->root; |
|
580 | + return $complete ? $this->domain().$this->root : $this->root; |
|
581 | 581 | } |
582 | 582 | |
583 | 583 | /** |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base; |
592 | 592 | |
593 | 593 | if ('' != $root) { |
594 | - $root = '/' . ltrim($root, '/'); |
|
594 | + $root = '/'.ltrim($root, '/'); |
|
595 | 595 | } |
596 | 596 | |
597 | 597 | return $root; |
@@ -1334,7 +1334,7 @@ discard block |
||
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 | } |
@@ -1547,7 +1547,7 @@ discard block |
||
1547 | 1547 | */ |
1548 | 1548 | public function isJson(): bool |
1549 | 1549 | { |
1550 | - $acceptType = $this->type(); |
|
1550 | + $acceptType = $this->type(); |
|
1551 | 1551 | |
1552 | 1552 | return false !== strpos($acceptType, 'json'); |
1553 | 1553 | } |