@@ -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 助手函数 |
@@ -190,12 +190,12 @@ discard block |
||
190 | 190 | $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output); |
191 | 191 | |
192 | 192 | if (PHP_SAPI == 'cli') { |
193 | - $output = PHP_EOL . $output . PHP_EOL; |
|
193 | + $output = PHP_EOL.$output.PHP_EOL; |
|
194 | 194 | } else { |
195 | 195 | if (!extension_loaded('xdebug')) { |
196 | 196 | $output = htmlspecialchars($output, ENT_SUBSTITUTE); |
197 | 197 | } |
198 | - $output = '<pre>' . $output . '</pre>'; |
|
198 | + $output = '<pre>'.$output.'</pre>'; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | echo $output; |
@@ -274,8 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | return isset($has) ? |
277 | - request()->has($key, $method) : |
|
278 | - request()->$method($key, $default, $filter); |
|
277 | + request()->has($key, $method) : request()->$method($key, $default, $filter); |
|
279 | 278 | } |
280 | 279 | } |
281 | 280 | |
@@ -352,7 +351,7 @@ discard block |
||
352 | 351 | function parse_name(string $name, int $type = 0, bool $ucfirst = true): string |
353 | 352 | { |
354 | 353 | if ($type) { |
355 | - $name = preg_replace_callback('/_([a-zA-Z])/', function ($match) { |
|
354 | + $name = preg_replace_callback('/_([a-zA-Z])/', function($match) { |
|
356 | 355 | return strtoupper($match[1]); |
357 | 356 | }, $name); |
358 | 357 | |
@@ -459,7 +458,7 @@ discard block |
||
459 | 458 | { |
460 | 459 | $token = Request::buildToken($name, $type); |
461 | 460 | |
462 | - return '<input type="hidden" name="' . $name . '" value="' . $token . '" />'; |
|
461 | + return '<input type="hidden" name="'.$name.'" value="'.$token.'" />'; |
|
463 | 462 | } |
464 | 463 | } |
465 | 464 | |
@@ -474,7 +473,7 @@ discard block |
||
474 | 473 | { |
475 | 474 | $token = Request::buildToken($name, $type); |
476 | 475 | |
477 | - return '<meta name="csrf-token" content="' . $token . '">'; |
|
476 | + return '<meta name="csrf-token" content="'.$token.'">'; |
|
478 | 477 | } |
479 | 478 | } |
480 | 479 | |
@@ -599,7 +598,7 @@ discard block |
||
599 | 598 | */ |
600 | 599 | function app_path($path = '') |
601 | 600 | { |
602 | - return app()->getAppPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
601 | + return app()->getAppPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
603 | 602 | } |
604 | 603 | } |
605 | 604 | |
@@ -612,7 +611,7 @@ discard block |
||
612 | 611 | */ |
613 | 612 | function base_path($path = '') |
614 | 613 | { |
615 | - return app()->getBasePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
614 | + return app()->getBasePath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
616 | 615 | } |
617 | 616 | } |
618 | 617 | |
@@ -625,7 +624,7 @@ discard block |
||
625 | 624 | */ |
626 | 625 | function config_path($path = '') |
627 | 626 | { |
628 | - return app()->getConfigPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
627 | + return app()->getConfigPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
629 | 628 | } |
630 | 629 | } |
631 | 630 | |
@@ -638,7 +637,7 @@ discard block |
||
638 | 637 | */ |
639 | 638 | function public_path($path = '') |
640 | 639 | { |
641 | - return app()->getRootPath() . ($path ? ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $path); |
|
640 | + return app()->getRootPath().($path ? ltrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $path); |
|
642 | 641 | } |
643 | 642 | } |
644 | 643 | |
@@ -651,7 +650,7 @@ discard block |
||
651 | 650 | */ |
652 | 651 | function runtime_path($path = '') |
653 | 652 | { |
654 | - return app()->getRuntimePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
653 | + return app()->getRuntimePath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
655 | 654 | } |
656 | 655 | } |
657 | 656 | |
@@ -664,6 +663,6 @@ discard block |
||
664 | 663 | */ |
665 | 664 | function root_path($path = '') |
666 | 665 | { |
667 | - return app()->getRootPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
666 | + return app()->getRootPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
668 | 667 | } |
669 | 668 | } |