Skip to content

Commit

Permalink
Lets be explicit with exception type
Browse files Browse the repository at this point in the history
  • Loading branch information
jkocik committed Sep 14, 2020
1 parent 9ee19f6 commit c472cc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/Events/ExceptionHandling.php
Expand Up @@ -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;
}
Expand Down
9 changes: 3 additions & 6 deletions src/LaravelListeners/ExceptionListener.php
Expand Up @@ -2,15 +2,15 @@

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;

class ExceptionListener implements LaravelListener
{
/**
* @var mixed
* @var Throwable
*/
protected $exception;

Expand All @@ -24,10 +24,7 @@ public function listen(): void
});
}

/**
* @return mixed
*/
public function exception()
public function exception(): ?Throwable
{
return $this->exception;
}
Expand Down

0 comments on commit c472cc3

Please sign in to comment.