Skip to content

Commit 1b49b4f

Browse files
authored
Merge pull request #2 from xiaodit/analysis-zDkrjb
Apply fixes from StyleCI
2 parents 1302801 + 9de09c5 commit 1b49b4f

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/Config/config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
return [
44
// 是否Whoops接管 默认 开启
55
'enable' => true,
6-
6+
77
// 帮助您从异常堆栈跟踪中打开代码编辑器
88
// 支持编辑器 sublime,textmate,emacs,macvim,phpstorm,idea,vscode,atom,espresso
99
'editor' => '',
1010

1111
// 页面title提示
12-
'title' => '发生内部错误,请稍后再试'
13-
];
12+
'title' => '发生内部错误,请稍后再试',
13+
];

src/Hander/Whoops.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
namespace think\Whoops\Hander;
66

77
use think\App;
8+
use think\exception\Handle;
89
use think\Response;
910
use think\Whoops\Runner;
10-
use think\exception\Handle;
1111
use Throwable;
1212
use Whoops\Handler\JsonResponseHandler;
1313
use Whoops\Handler\PrettyPageHandler;
@@ -26,11 +26,11 @@ public function render($request, Throwable $e): Response
2626
{
2727
// Whoops 接管请求异常
2828
if (config('whoops.enable') && $this->app->isDebug()) {
29-
$this->runner->pushHandler(new PrettyPageHandler);
29+
$this->runner->pushHandler(new PrettyPageHandler());
3030

3131
// 兼容 Cors请求
3232
if ($request->isAjax() || $_SERVER['HTTP_SEC_FETCH_MODE'] === 'cors') {
33-
$this->runner->pushHandler(new JsonResponseHandler);
33+
$this->runner->pushHandler(new JsonResponseHandler());
3434
}
3535

3636
$this->runner->register();

src/Runner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
use think\App;
66
use think\Facade\Request;
7-
use Whoops\Run;
87
use Whoops\Handler\PrettyPageHandler;
8+
use Whoops\Run;
99

1010
class Runner
1111
{
1212
private $run;
1313

1414
private $options = [
1515
'editor' => '',
16-
'title' => '发生内部错误,请稍后再试'
16+
'title' => '发生内部错误,请稍后再试',
1717
];
1818

1919
public function __construct(Run $run)
@@ -42,7 +42,7 @@ public function handleException($exception)
4242
'Base URL' => Request::baseUrl(),
4343
'Scheme' => Request::scheme(),
4444
'Port' => Request::port(),
45-
'Host' => Request::host()
45+
'Host' => Request::host(),
4646
]);
4747

4848
if ($this->options['editor']) {

src/WhoopsService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
declare(strict_types = 1);
2+
3+
declare(strict_types=1);
34

45
namespace think\Whoops;
56

0 commit comments

Comments
 (0)