From 8f0c2953a0553e6c451f0f2df7a4337716bf9fc6 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 1 Feb 2021 13:22:12 +0100 Subject: [PATCH 1/3] Fix report method for ViewException --- .../Foundation/Console/stubs/exception-render-report.stub | 2 +- .../Foundation/Console/stubs/exception-report.stub | 2 +- src/Illuminate/View/ViewException.php | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Foundation/Console/stubs/exception-render-report.stub b/src/Illuminate/Foundation/Console/stubs/exception-render-report.stub index 712a40789e76..4d1070c2f687 100644 --- a/src/Illuminate/Foundation/Console/stubs/exception-render-report.stub +++ b/src/Illuminate/Foundation/Console/stubs/exception-render-report.stub @@ -9,7 +9,7 @@ class DummyClass extends Exception /** * Report the exception. * - * @return void + * @return bool|null */ public function report() { diff --git a/src/Illuminate/Foundation/Console/stubs/exception-report.stub b/src/Illuminate/Foundation/Console/stubs/exception-report.stub index 8db5c4f3c2b2..643149863e91 100644 --- a/src/Illuminate/Foundation/Console/stubs/exception-report.stub +++ b/src/Illuminate/Foundation/Console/stubs/exception-report.stub @@ -9,7 +9,7 @@ class DummyClass extends Exception /** * Report the exception. * - * @return void + * @return bool|null */ public function report() { diff --git a/src/Illuminate/View/ViewException.php b/src/Illuminate/View/ViewException.php index 9c9463bc28ac..1f32d643fff9 100644 --- a/src/Illuminate/View/ViewException.php +++ b/src/Illuminate/View/ViewException.php @@ -3,20 +3,22 @@ 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); } } From cf6a473fd26510e468066060cdded9d986a3d9ca Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 1 Feb 2021 14:25:32 +0100 Subject: [PATCH 2/3] Update ViewException.php --- src/Illuminate/View/ViewException.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/View/ViewException.php b/src/Illuminate/View/ViewException.php index 1f32d643fff9..6a26e0d6333f 100644 --- a/src/Illuminate/View/ViewException.php +++ b/src/Illuminate/View/ViewException.php @@ -20,6 +20,8 @@ public function report() if (Reflector::isCallable($reportCallable = [$exception, 'report'])) { return Container::getInstance()->call($reportCallable); } + + return false; } /** From 50d997c4d9fc94eb33bb59313529502391a69d83 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 1 Feb 2021 14:26:15 +0100 Subject: [PATCH 3/3] Apply fixes from StyleCI (#36111) --- src/Illuminate/View/ViewException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/View/ViewException.php b/src/Illuminate/View/ViewException.php index 6a26e0d6333f..e6797a29a1e7 100644 --- a/src/Illuminate/View/ViewException.php +++ b/src/Illuminate/View/ViewException.php @@ -20,7 +20,7 @@ public function report() if (Reflector::isCallable($reportCallable = [$exception, 'report'])) { return Container::getInstance()->call($reportCallable); } - + return false; }