Skip to content

Commit

Permalink
[6.x] Fix report method for ViewException (#36110)
Browse files Browse the repository at this point in the history
* Fix report method for ViewException

* Update ViewException.php

* Apply fixes from StyleCI (#36111)
  • Loading branch information
driesvints authored Feb 1, 2021
1 parent 0966a30 commit 8182329
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DummyClass extends Exception
/**
* Report the exception.
*
* @return void
* @return bool|null
*/
public function report()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DummyClass extends Exception
/**
* Report the exception.
*
* @return void
* @return bool|null
*/
public function report()
{
Expand Down
10 changes: 7 additions & 3 deletions src/Illuminate/View/ViewException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
namespace Illuminate\View;

use ErrorException;
use Illuminate\Container\Container;
use Illuminate\Support\Reflector;

class ViewException extends ErrorException
{
/**
* Report the exception.
*
* @return void
* @return bool|null
*/
public function report()
{
$exception = $this->getPrevious();

if ($exception && method_exists($exception, 'report')) {
$exception->report();
if (Reflector::isCallable($reportCallable = [$exception, 'report'])) {
return Container::getInstance()->call($reportCallable);
}

return false;
}

/**
Expand Down

0 comments on commit 8182329

Please sign in to comment.