Skip to content

Commit f54b5e0

Browse files
authored
Match service provider after resolved (#48824)
1 parent 56f5c86 commit f54b5e0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Illuminate/Support/Facades/Facade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ public static function resolved(Closure $callback)
4646
$accessor = static::getFacadeAccessor();
4747

4848
if (static::$app->resolved($accessor) === true) {
49-
$callback(static::getFacadeRoot());
49+
$callback(static::getFacadeRoot(), static::$app);
5050
}
5151

52-
static::$app->afterResolving($accessor, function ($service) use ($callback) {
53-
$callback($service);
52+
static::$app->afterResolving($accessor, function ($service, $app) use ($callback) {
53+
$callback($service, $app);
5454
});
5555
}
5656

tests/Integration/Support/FacadesTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Illuminate\Tests\Integration\Support;
44

5+
use Illuminate\Auth\AuthManager;
6+
use Illuminate\Foundation\Application;
57
use Illuminate\Support\Collection;
68
use Illuminate\Support\Facades\Auth;
79
use Illuminate\Support\Facades\Facade;
@@ -19,7 +21,7 @@ protected function tearDown(): void
1921

2022
public function testFacadeResolvedCanResolveCallback()
2123
{
22-
Auth::resolved(function () {
24+
Auth::resolved(function (AuthManager $auth, Application $app) {
2325
$_SERVER['__laravel.authResolved'] = true;
2426
});
2527

@@ -36,7 +38,7 @@ public function testFacadeResolvedCanResolveCallbackAfterAccessRootHasBeenResolv
3638

3739
$this->assertFalse(isset($_SERVER['__laravel.authResolved']));
3840

39-
Auth::resolved(function () {
41+
Auth::resolved(function (AuthManager $auth, Application $app) {
4042
$_SERVER['__laravel.authResolved'] = true;
4143
});
4244

0 commit comments

Comments
 (0)