@@ -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 | //------------------------ |
| 14 | 14 | // ThinkPHP 助手函数 |
@@ -227,12 +227,12 @@ discard block |
||
| 227 | 227 | $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output); |
| 228 | 228 | |
| 229 | 229 | if (PHP_SAPI == 'cli') { |
| 230 | - $output = PHP_EOL . $output . PHP_EOL; |
|
| 230 | + $output = PHP_EOL.$output.PHP_EOL; |
|
| 231 | 231 | } else { |
| 232 | 232 | if (!extension_loaded('xdebug')) { |
| 233 | 233 | $output = htmlspecialchars($output, ENT_SUBSTITUTE); |
| 234 | 234 | } |
| 235 | - $output = '<pre>' . $output . '</pre>'; |
|
| 235 | + $output = '<pre>'.$output.'</pre>'; |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | echo $output; |
@@ -311,8 +311,7 @@ discard block |
||
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | return isset($has) ? |
| 314 | - request()->has($key, $method) : |
|
| 315 | - request()->$method($key, $default, $filter); |
|
| 314 | + request()->has($key, $method) : request()->$method($key, $default, $filter); |
|
| 316 | 315 | } |
| 317 | 316 | } |
| 318 | 317 | |
@@ -389,7 +388,7 @@ discard block |
||
| 389 | 388 | function parse_name(string $name, int $type = 0, bool $ucfirst = true): string |
| 390 | 389 | { |
| 391 | 390 | if ($type) { |
| 392 | - $name = preg_replace_callback('/_([a-zA-Z])/', function ($match) { |
|
| 391 | + $name = preg_replace_callback('/_([a-zA-Z])/', function($match) { |
|
| 393 | 392 | return strtoupper($match[1]); |
| 394 | 393 | }, $name); |
| 395 | 394 | |
@@ -494,7 +493,7 @@ discard block |
||
| 494 | 493 | { |
| 495 | 494 | $token = Request::buildToken($name, $type); |
| 496 | 495 | |
| 497 | - return '<input type="hidden" name="' . $name . '" value="' . $token . '" />'; |
|
| 496 | + return '<input type="hidden" name="'.$name.'" value="'.$token.'" />'; |
|
| 498 | 497 | } |
| 499 | 498 | } |
| 500 | 499 | |
@@ -509,7 +508,7 @@ discard block |
||
| 509 | 508 | { |
| 510 | 509 | $token = Request::buildToken($name, $type); |
| 511 | 510 | |
| 512 | - return '<meta name="csrf-token" content="' . $token . '">'; |
|
| 511 | + return '<meta name="csrf-token" content="'.$token.'">'; |
|
| 513 | 512 | } |
| 514 | 513 | } |
| 515 | 514 | |
@@ -651,7 +650,7 @@ discard block |
||
| 651 | 650 | */ |
| 652 | 651 | function app_path($path = '') |
| 653 | 652 | { |
| 654 | - return app()->getAppPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 653 | + return app()->getAppPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 655 | 654 | } |
| 656 | 655 | } |
| 657 | 656 | |
@@ -664,7 +663,7 @@ discard block |
||
| 664 | 663 | */ |
| 665 | 664 | function base_path($path = '') |
| 666 | 665 | { |
| 667 | - return app()->getBasePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 666 | + return app()->getBasePath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 668 | 667 | } |
| 669 | 668 | } |
| 670 | 669 | |
@@ -677,7 +676,7 @@ discard block |
||
| 677 | 676 | */ |
| 678 | 677 | function config_path($path = '') |
| 679 | 678 | { |
| 680 | - return app()->getConfigPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 679 | + return app()->getConfigPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 681 | 680 | } |
| 682 | 681 | } |
| 683 | 682 | |
@@ -690,7 +689,7 @@ discard block |
||
| 690 | 689 | */ |
| 691 | 690 | function public_path($path = '') |
| 692 | 691 | { |
| 693 | - return app()->getRootPath() . ($path ? ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $path); |
|
| 692 | + return app()->getRootPath().($path ? ltrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $path); |
|
| 694 | 693 | } |
| 695 | 694 | } |
| 696 | 695 | |
@@ -703,7 +702,7 @@ discard block |
||
| 703 | 702 | */ |
| 704 | 703 | function runtime_path($path = '') |
| 705 | 704 | { |
| 706 | - return app()->getRuntimePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 705 | + return app()->getRuntimePath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 707 | 706 | } |
| 708 | 707 | } |
| 709 | 708 | |
@@ -716,6 +715,6 @@ discard block |
||
| 716 | 715 | */ |
| 717 | 716 | function root_path($path = '') |
| 718 | 717 | { |
| 719 | - return app()->getRootPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 718 | + return app()->getRootPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 720 | 719 | } |
| 721 | 720 | } |