From 321bd67689739f2e24b5b72738f9121f8c013bad Mon Sep 17 00:00:00 2001 From: thdaguin <61747970+thdaguin@users.noreply.github.com> Date: Sun, 26 Feb 2023 13:37:09 +0100 Subject: [PATCH] fix: getFileName() now returns null if empty filename If no log files exist (ie after deleting all files), a deprecation is emited by getFileName function (#277) --- src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index b224eda..1b20a8e 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -138,6 +138,10 @@ public function getFolderName() */ public function getFileName() { + if(!$this->file) { + return null; + } + return basename($this->file); }