From dc0eeabe5ef9d97093f9d485601d8c446dcf3e8b Mon Sep 17 00:00:00 2001 From: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com> Date: Thu, 13 Nov 2025 06:15:08 -0500 Subject: [PATCH] Update ApplicationBuilder.php --- .../Configuration/ApplicationBuilder.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php b/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php index e386d8273c8e..e9bad20719b3 100644 --- a/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php +++ b/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php @@ -363,7 +363,7 @@ public function withSchedule(callable $callback) /** * Register and configure the application's exception handler. * - * @param callable|null $using + * @param callable(\Illuminate\Foundation\Configuration\Exceptions)|null $using * @return $this */ public function withExceptions(?callable $using = null) @@ -373,12 +373,12 @@ public function withExceptions(?callable $using = null) \Illuminate\Foundation\Exceptions\Handler::class ); - $using ??= fn () => true; - - $this->app->afterResolving( - \Illuminate\Foundation\Exceptions\Handler::class, - fn ($handler) => $using(new Exceptions($handler)), - ); + if ($using !== null) { + $this->app->afterResolving( + \Illuminate\Foundation\Exceptions\Handler::class, + fn ($handler) => $using(new Exceptions($handler)), + ); + } return $this; }