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 d2973fd

Browse filesBrowse files
committed
fix: intersect Authenticatable with Model in UserProvider
1 parent ee8dcf1 commit d2973fd
Copy full SHA for d2973fd

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+16
-16
lines changed

‎src/Illuminate/Auth/EloquentUserProvider.php

Copy file name to clipboardExpand all lines: src/Illuminate/Auth/EloquentUserProvider.php
+10-10Lines changed: 10 additions & 10 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

@@ -48,7 +48,7 @@ public function __construct(HasherContract $hasher, $model)
4848
* Retrieve a user by their unique identifier.
4949
*
5050
* @param mixed $identifier
51-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
51+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
5252
*/
5353
public function retrieveById($identifier)
5454
{
@@ -64,7 +64,7 @@ public function retrieveById($identifier)
6464
*
6565
* @param mixed $identifier
6666
* @param string $token
67-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
67+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
6868
*/
6969
public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
7070
{
@@ -86,7 +86,7 @@ public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
8686
/**
8787
* Update the "remember me" token for the given user in storage.
8888
*
89-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
89+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
9090
* @param string $token
9191
* @return void
9292
*/
@@ -107,7 +107,7 @@ public function updateRememberToken(UserContract $user, #[\SensitiveParameter] $
107107
* Retrieve a user by the given credentials.
108108
*
109109
* @param array $credentials
110-
* @return \Illuminate\Contracts\Auth\Authenticatable|null
110+
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
111111
*/
112112
public function retrieveByCredentials(#[\SensitiveParameter] array $credentials)
113113
{
@@ -142,7 +142,7 @@ public function retrieveByCredentials(#[\SensitiveParameter] array $credentials)
142142
/**
143143
* Validate a user against the given credentials.
144144
*
145-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
145+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
146146
* @param array $credentials
147147
* @return bool
148148
*/
@@ -162,7 +162,7 @@ public function validateCredentials(UserContract $user, #[\SensitiveParameter] a
162162
/**
163163
* Rehash the user's password if required and supported.
164164
*
165-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
165+
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
166166
* @param array $credentials
167167
* @param bool $force
168168
* @return void
@@ -200,7 +200,7 @@ protected function newModelQuery($model = null)
200200
/**
201201
* Create a new instance of the model.
202202
*
203-
* @return \Illuminate\Database\Eloquent\Model
203+
* @return \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model
204204
*/
205205
public function createModel()
206206
{
@@ -235,7 +235,7 @@ public function setHasher(HasherContract $hasher)
235235
/**
236236
* Gets the name of the Eloquent user model.
237237
*
238-
* @return string
238+
* @return class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model>
239239
*/
240240
public function getModel()
241241
{
@@ -245,7 +245,7 @@ public function getModel()
245245
/**
246246
* Sets the name of the Eloquent user model.
247247
*
248-
* @param string $model
248+
* @param class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model> $model
249249
* @return $this
250250
*/
251251
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.