From 0f27a27a8fd54d682eff8a021bf6f37eb42c2ada Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 23 Mar 2023 21:52:51 -0400 Subject: [PATCH] Cleanup, PHP 8.2 --- src/services/LoggerService.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/services/LoggerService.php b/src/services/LoggerService.php index 99bbffa..3f1ae2e 100644 --- a/src/services/LoggerService.php +++ b/src/services/LoggerService.php @@ -56,19 +56,17 @@ public function handleException($exception): void */ public function writeException($data): void { - $path = Craft::$app->path->getLogPath(); - - $logfile = 'simplelogger.json'; + $logfile = Craft::$app->path->getLogPath() . '/simplelogger.json'; - if (!@file_exists($path . '/' . $logfile)) { - @file_put_contents($path . '/' . $logfile, '[]'); + if (!@file_exists($logfile)) { + @file_put_contents($logfile, '[]'); } - $json = @file_get_contents($path . '/' . $logfile); + $json = @file_get_contents($logfile); $array = Json::decode($json); $array[] = $data; - @file_put_contents($path . '/' . $logfile, Json::encode($array)); + @file_put_contents($logfile, Json::encode($array)); } /**