Skip to content

Commit 587adc5

Browse files
authored
[9.x] Refactor some closure to arrow functions (#42610)
1 parent 0485e3a commit 587adc5

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/Illuminate/Auth/AuthManager.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function __construct($app)
5050
{
5151
$this->app = $app;
5252

53-
$this->userResolver = function ($guard = null) {
54-
return $this->guard($guard)->user();
55-
};
53+
$this->userResolver = fn ($guard = null) => $this->guard($guard)->user();
5654
}
5755

5856
/**
@@ -204,9 +202,7 @@ public function shouldUse($name)
204202

205203
$this->setDefaultDriver($name);
206204

207-
$this->userResolver = function ($name = null) {
208-
return $this->guard($name)->user();
209-
};
205+
$this->userResolver = fn ($name = null) => $this->guard($name)->user();
210206
}
211207

212208
/**

src/Illuminate/Auth/AuthServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ protected function registerAuthenticator()
4646
*/
4747
protected function registerUserResolver()
4848
{
49-
$this->app->bind(AuthenticatableContract::class, function ($app) {
50-
return call_user_func($app['auth']->userResolver());
51-
});
49+
$this->app->bind(AuthenticatableContract::class, fn ($app) => call_user_func($app['auth']->userResolver()));
5250
}
5351

5452
/**

0 commit comments

Comments
 (0)