Skip to content

Commit 74ba103

Browse files
committed
feat: switch to new config API
1 parent cd5aea6 commit 74ba103

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Exception/General.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function handleErrors($errno, $errstr = '', $errfile = '', $errlin
6666
try {
6767
throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
6868
} catch (\Throwable $th) {
69-
$app = \Leaf\Config::get('app')['instance'];
69+
$app = \Leaf\Config::get('app');
7070

7171
if ($app && $app->config('log.enabled')) {
7272
$app->logger()->error($th);
@@ -229,9 +229,9 @@ public static function csrf($error = null)
229229
public static function defaultError($e = null)
230230
{
231231
if ($e) {
232-
$app = \Leaf\Config::get("app")["instance"];
232+
$app = \Leaf\Config::get('app');
233233

234-
if ($app && $app->config("log.enabled")) {
234+
if ($app && $app->config('log.enabled')) {
235235
$app->logger()->error($e);
236236
}
237237
}

src/Exception/Run.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ public function handleError($level, $message, $file = null, $line = null)
457457
// XXX we pass $level for the "code" param only for BC reasons.
458458
// see https://github.com/filp/whoops/issues/267
459459
$exception = new ErrorException($message, /*code*/ $level, /*severity*/ $level, $file, $line);
460-
$app = \Leaf\Config::get("app")["instance"];
460+
$app = \Leaf\Config::get('app');
461461

462-
if ($app && $app->config("log.enabled")) {
462+
if ($app && $app->config('log.enabled')) {
463463
$app->logger()->error($exception);
464464
}
465465

0 commit comments

Comments
 (0)