From a9d93866bd17f5ac22df673d3110621173c62d82 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Tue, 19 Sep 2023 11:36:29 +0200 Subject: [PATCH] Add dontReportDuplicates and fixes return types --- src/Adapters/Laravel/ExceptionHandler.php | 26 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/Adapters/Laravel/ExceptionHandler.php b/src/Adapters/Laravel/ExceptionHandler.php index 5120fe6..6944ec8 100644 --- a/src/Adapters/Laravel/ExceptionHandler.php +++ b/src/Adapters/Laravel/ExceptionHandler.php @@ -86,22 +86,38 @@ public function shouldReport(Throwable $e) } /** - * Register a renderable callback. + * Register a reportable callback. * - * @return $this + * @param callable $reportUsing + * @return \Illuminate\Foundation\Exceptions\ReportableHandler */ public function reportable(callable $reportUsing) { - $this->appExceptionHandler->reportable($reportUsing); // @phpstan-ignore-line + return $this->appExceptionHandler->reportable($reportUsing); // @phpstan-ignore-line } /** - * Register a reportable callback. + * Register a renderable callback. * - * @return \Illuminate\Foundation\Exceptions\ReportableHandler + * @param callable $renderUsing + * @return $this */ public function renderable(callable $renderUsing) { $this->appExceptionHandler->renderable($renderUsing); // @phpstan-ignore-line + + return $this; + } + + /** + * Do not report duplicate exceptions. + * + * @return $this + */ + public function dontReportDuplicates() + { + $this->appExceptionHandler->dontReportDuplicates(); // @phpstan-ignore-line + + return $this; } }