From bc9154066961bcb440f85b65df62708f559d43cb Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Thu, 26 Oct 2023 16:08:35 +1100 Subject: [PATCH] Match service provider after resolved --- src/Illuminate/Support/Facades/Facade.php | 6 +++--- tests/Integration/Support/FacadesTest.php | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Support/Facades/Facade.php b/src/Illuminate/Support/Facades/Facade.php index c5a01e7ae2ec..80c58bba7b5b 100755 --- a/src/Illuminate/Support/Facades/Facade.php +++ b/src/Illuminate/Support/Facades/Facade.php @@ -46,11 +46,11 @@ public static function resolved(Closure $callback) $accessor = static::getFacadeAccessor(); if (static::$app->resolved($accessor) === true) { - $callback(static::getFacadeRoot()); + $callback(static::getFacadeRoot(), static::$app); } - static::$app->afterResolving($accessor, function ($service) use ($callback) { - $callback($service); + static::$app->afterResolving($accessor, function ($service, $app) use ($callback) { + $callback($service, $app); }); } diff --git a/tests/Integration/Support/FacadesTest.php b/tests/Integration/Support/FacadesTest.php index 6d067539bf1e..7a1c833c2be3 100644 --- a/tests/Integration/Support/FacadesTest.php +++ b/tests/Integration/Support/FacadesTest.php @@ -2,6 +2,8 @@ namespace Illuminate\Tests\Integration\Support; +use Illuminate\Auth\AuthManager; +use Illuminate\Foundation\Application; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Facade; @@ -19,7 +21,7 @@ protected function tearDown(): void public function testFacadeResolvedCanResolveCallback() { - Auth::resolved(function () { + Auth::resolved(function (AuthManager $auth, Application $app) { $_SERVER['__laravel.authResolved'] = true; }); @@ -36,7 +38,7 @@ public function testFacadeResolvedCanResolveCallbackAfterAccessRootHasBeenResolv $this->assertFalse(isset($_SERVER['__laravel.authResolved'])); - Auth::resolved(function () { + Auth::resolved(function (AuthManager $auth, Application $app) { $_SERVER['__laravel.authResolved'] = true; });