From c472cc383913a85c07627479bec2c40949a550ee Mon Sep 17 00:00:00 2001 From: Janusz Kocik Date: Mon, 14 Sep 2020 15:25:24 -0700 Subject: [PATCH] Lets be explicit with exception type --- src/Events/ExceptionHandling.php | 8 +++++--- src/LaravelListeners/ExceptionListener.php | 9 +++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Events/ExceptionHandling.php b/src/Events/ExceptionHandling.php index 93233cc..115c7bb 100644 --- a/src/Events/ExceptionHandling.php +++ b/src/Events/ExceptionHandling.php @@ -2,18 +2,20 @@ namespace JKocik\Laravel\Profiler\Events; +use Throwable; + class ExceptionHandling { /** - * @var mixed + * @var Throwable */ public $exception; /** * ExceptionHandling constructor. - * @param $exception + * @param Throwable $exception */ - public function __construct($exception) + public function __construct(Throwable $exception) { $this->exception = $exception; } diff --git a/src/LaravelListeners/ExceptionListener.php b/src/LaravelListeners/ExceptionListener.php index 532b118..89a6f36 100644 --- a/src/LaravelListeners/ExceptionListener.php +++ b/src/LaravelListeners/ExceptionListener.php @@ -2,7 +2,7 @@ namespace JKocik\Laravel\Profiler\LaravelListeners; -use Exception; +use Throwable; use Illuminate\Support\Facades\Event; use JKocik\Laravel\Profiler\Events\ExceptionHandling; use JKocik\Laravel\Profiler\Contracts\LaravelListener; @@ -10,7 +10,7 @@ class ExceptionListener implements LaravelListener { /** - * @var mixed + * @var Throwable */ protected $exception; @@ -24,10 +24,7 @@ public function listen(): void }); } - /** - * @return mixed - */ - public function exception() + public function exception(): ?Throwable { return $this->exception; }