@@ -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 | |
@@ -453,7 +452,7 @@ discard block |
||
| 453 | 452 | { |
| 454 | 453 | $token = Request::buildToken($name, $type); |
| 455 | 454 | |
| 456 | - return '<input type="hidden" name="' . $name . '" value="' . $token . '" />'; |
|
| 455 | + return '<input type="hidden" name="'.$name.'" value="'.$token.'" />'; |
|
| 457 | 456 | } |
| 458 | 457 | } |
| 459 | 458 | |
@@ -468,7 +467,7 @@ discard block |
||
| 468 | 467 | { |
| 469 | 468 | $token = Request::buildToken($name, $type); |
| 470 | 469 | |
| 471 | - return '<meta name="csrf-token" content="' . $token . '">'; |
|
| 470 | + return '<meta name="csrf-token" content="'.$token.'">'; |
|
| 472 | 471 | } |
| 473 | 472 | } |
| 474 | 473 | |
@@ -593,7 +592,7 @@ discard block |
||
| 593 | 592 | */ |
| 594 | 593 | function app_path($path = '') |
| 595 | 594 | { |
| 596 | - return app()->getAppPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 595 | + return app()->getAppPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 597 | 596 | } |
| 598 | 597 | } |
| 599 | 598 | |
@@ -606,7 +605,7 @@ discard block |
||
| 606 | 605 | */ |
| 607 | 606 | function base_path($path = '') |
| 608 | 607 | { |
| 609 | - return app()->getBasePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 608 | + return app()->getBasePath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 610 | 609 | } |
| 611 | 610 | } |
| 612 | 611 | |
@@ -619,7 +618,7 @@ discard block |
||
| 619 | 618 | */ |
| 620 | 619 | function config_path($path = '') |
| 621 | 620 | { |
| 622 | - return app()->getConfigPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 621 | + return app()->getConfigPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 623 | 622 | } |
| 624 | 623 | } |
| 625 | 624 | |
@@ -632,7 +631,7 @@ discard block |
||
| 632 | 631 | */ |
| 633 | 632 | function public_path($path = '') |
| 634 | 633 | { |
| 635 | - return app()->getRootPath() . 'public' . DIRECTORY_SEPARATOR . ($path ? ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $path); |
|
| 634 | + return app()->getRootPath().'public'.DIRECTORY_SEPARATOR.($path ? ltrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $path); |
|
| 636 | 635 | } |
| 637 | 636 | } |
| 638 | 637 | |
@@ -645,7 +644,7 @@ discard block |
||
| 645 | 644 | */ |
| 646 | 645 | function runtime_path($path = '') |
| 647 | 646 | { |
| 648 | - return app()->getRuntimePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 647 | + return app()->getRuntimePath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 649 | 648 | } |
| 650 | 649 | } |
| 651 | 650 | |
@@ -658,6 +657,6 @@ discard block |
||
| 658 | 657 | */ |
| 659 | 658 | function root_path($path = '') |
| 660 | 659 | { |
| 661 | - return app()->getRootPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); |
|
| 660 | + return app()->getRootPath().($path ? $path.DIRECTORY_SEPARATOR : $path); |
|
| 662 | 661 | } |
| 663 | 662 | } |