Skip to content

Commit b0c8cf2

Browse files
committed
Add $whoopsHandler as variable, can be used by other scripts
1 parent da1816c commit b0c8cf2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

system/exception.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
*/
1010

1111
use MyAAC\Exceptions\SensitiveException;
12+
use Whoops\Handler\PlainTextHandler;
13+
use Whoops\Handler\PrettyPageHandler;
14+
use Whoops\Run;
1215

13-
if (class_exists(\Whoops\Run::class)) {
14-
$whoops = new \Whoops\Run;
15-
if(IS_CLI) {
16-
$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
17-
}
18-
else {
19-
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
20-
}
16+
if (class_exists(Run::class)) {
17+
$whoops = new Run;
18+
19+
$whoopsHandler = IS_CLI ? (new PlainTextHandler()) : (new PrettyPageHandler());
2120

21+
$whoops->pushHandler($whoopsHandler);
2222
$whoops->register();
2323
return;
2424
}

0 commit comments

Comments
 (0)