Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 70575df

Browse filesBrowse files
authored
fix: intersect Authenticatable with Model in UserProvider (#54061)
1 parent 7eecb78 commit 70575df
Copy full SHA for 70575df

File tree

Expand file treeCollapse file tree

2 files changed

+15
-15
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-15
lines changed

‎src/Illuminate/Auth/EloquentUserProvider.php

Copy file name to clipboardExpand all lines: src/Illuminate/Auth/EloquentUserProvider.php
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class EloquentUserProvider implements UserProvider
2020
/**
2121
* The Eloquent user model.
2222
*
23-
* @var string
23+
* @var class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model>
2424
*/
2525
protected $model;
2626

@@ -47,7 +47,7 @@ public function __construct(HasherContract $hasher, $model)
4747
* Retrieve a user by their unique identifier.
4848
*
4949
* @param mixed $identifier
50-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
50+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
5151
*/
5252
public function retrieveById($identifier)
5353
{
@@ -63,7 +63,7 @@ public function retrieveById($identifier)
6363
*
6464
* @param mixed $identifier
6565
* @param string $token
66-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
66+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
6767
*/
6868
public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
6969
{
@@ -85,7 +85,7 @@ public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
8585
/**
8686
* Update the "remember me" token for the given user in storage.
8787
*
88-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
88+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
8989
* @param string $token
9090
* @return void
9191
*/
@@ -106,7 +106,7 @@ public function updateRememberToken(UserContract $user, #[\SensitiveParameter] $
106106
* Retrieve a user by the given credentials.
107107
*
108108
* @param array $credentials
109-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
109+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
110110
*/
111111
public function retrieveByCredentials(#[\SensitiveParameter] array $credentials)
112112
{
@@ -161,7 +161,7 @@ public function validateCredentials(UserContract $user, #[\SensitiveParameter] a
161161
/**
162162
* Rehash the user's password if required and supported.
163163
*
164-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
164+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
165165
* @param array $credentials
166166
* @param bool $force
167167
* @return void
@@ -199,7 +199,7 @@ protected function newModelQuery($model = null)
199199
/**
200200
* Create a new instance of the model.
201201
*
202-
* @return \Illuminate\Database\Eloquent\Model
202+
* @return \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model
203203
*/
204204
public function createModel()
205205
{
@@ -234,7 +234,7 @@ public function setHasher(HasherContract $hasher)
234234
/**
235235
* Gets the name of the Eloquent user model.
236236
*
237-
* @return string
237+
* @return class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model>
238238
*/
239239
public function getModel()
240240
{
@@ -244,7 +244,7 @@ public function getModel()
244244
/**
245245
* Sets the name of the Eloquent user model.
246246
*
247-
* @param string $model
247+
* @param class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model> $model
248248
* @return $this
249249
*/
250250
public function setModel($model)

‎src/Illuminate/Contracts/Auth/UserProvider.php

Copy file name to clipboardExpand all lines: src/Illuminate/Contracts/Auth/UserProvider.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface UserProvider
88
* Retrieve a user by their unique identifier.
99
*
1010
* @param mixed $identifier
11-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
11+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
1212
*/
1313
public function retrieveById($identifier);
1414

@@ -17,14 +17,14 @@ public function retrieveById($identifier);
1717
*
1818
* @param mixed $identifier
1919
* @param string $token
20-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
20+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
2121
*/
2222
public function retrieveByToken($identifier, #[\SensitiveParameter] $token);
2323

2424
/**
2525
* Update the "remember me" token for the given user in storage.
2626
*
27-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
27+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
2828
* @param string $token
2929
* @return void
3030
*/
@@ -34,14 +34,14 @@ public function updateRememberToken(Authenticatable $user, #[\SensitiveParameter
3434
* Retrieve a user by the given credentials.
3535
*
3636
* @param array $credentials
37-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
37+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
3838
*/
3939
public function retrieveByCredentials(#[\SensitiveParameter] array $credentials);
4040

4141
/**
4242
* Validate a user against the given credentials.
4343
*
44-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
44+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
4545
* @param array $credentials
4646
* @return bool
4747
*/
@@ -50,7 +50,7 @@ public function validateCredentials(Authenticatable $user, #[\SensitiveParameter
5050
/**
5151
* Rehash the user's password if required and supported.
5252
*
53-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
53+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
5454
* @param array $credentials
5555
* @param bool $force
5656
* @return void

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.