Skip to content

Commit

Permalink
feat: switch to new config API
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Aug 23, 2024
1 parent cd5aea6 commit 74ba103
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Exception/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function handleErrors($errno, $errstr = '', $errfile = '', $errlin
try {
throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
} catch (\Throwable $th) {
$app = \Leaf\Config::get('app')['instance'];
$app = \Leaf\Config::get('app');

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

if ($app && $app->config("log.enabled")) {
if ($app && $app->config('log.enabled')) {
$app->logger()->error($e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ public function handleError($level, $message, $file = null, $line = null)
// XXX we pass $level for the "code" param only for BC reasons.
// see https://github.com/filp/whoops/issues/267
$exception = new ErrorException($message, /*code*/ $level, /*severity*/ $level, $file, $line);
$app = \Leaf\Config::get("app")["instance"];
$app = \Leaf\Config::get('app');

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

Expand Down

0 comments on commit 74ba103

Please sign in to comment.