Skip to content

Commit

Permalink
fix: intersect Authenticatable with Model in UserProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Jan 2, 2025
1 parent ee8dcf1 commit d2973fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EloquentUserProvider implements UserProvider
/**
* The Eloquent user model.
*
* @var string
* @var class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model>
*/
protected $model;

Expand Down Expand Up @@ -48,7 +48,7 @@ public function __construct(HasherContract $hasher, $model)
* Retrieve a user by their unique identifier.
*
* @param mixed $identifier
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
*/
public function retrieveById($identifier)
{
Expand All @@ -64,7 +64,7 @@ public function retrieveById($identifier)
*
* @param mixed $identifier
* @param string $token
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
*/
public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
{
Expand All @@ -86,7 +86,7 @@ public function retrieveByToken($identifier, #[\SensitiveParameter] $token)
/**
* Update the "remember me" token for the given user in storage.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
* @param string $token
* @return void
*/
Expand All @@ -107,7 +107,7 @@ public function updateRememberToken(UserContract $user, #[\SensitiveParameter] $
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
*/
public function retrieveByCredentials(#[\SensitiveParameter] array $credentials)
{
Expand Down Expand Up @@ -142,7 +142,7 @@ public function retrieveByCredentials(#[\SensitiveParameter] array $credentials)
/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
* @param array $credentials
* @return bool
*/
Expand All @@ -162,7 +162,7 @@ public function validateCredentials(UserContract $user, #[\SensitiveParameter] a
/**
* Rehash the user's password if required and supported.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
* @param array $credentials
* @param bool $force
* @return void
Expand Down Expand Up @@ -200,7 +200,7 @@ protected function newModelQuery($model = null)
/**
* Create a new instance of the model.
*
* @return \Illuminate\Database\Eloquent\Model
* @return \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model
*/
public function createModel()
{
Expand Down Expand Up @@ -235,7 +235,7 @@ public function setHasher(HasherContract $hasher)
/**
* Gets the name of the Eloquent user model.
*
* @return string
* @return class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model>
*/
public function getModel()
{
Expand All @@ -245,7 +245,7 @@ public function getModel()
/**
* Sets the name of the Eloquent user model.
*
* @param string $model
* @param class-string<\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model> $model
* @return $this
*/
public function setModel($model)
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Contracts/Auth/UserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface UserProvider
* Retrieve a user by their unique identifier.
*
* @param mixed $identifier
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
*/
public function retrieveById($identifier);

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

/**
* Update the "remember me" token for the given user in storage.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
* @param string $token
* @return void
*/
Expand All @@ -34,14 +34,14 @@ public function updateRememberToken(Authenticatable $user, #[\SensitiveParameter
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return (\Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model)|null
*/
public function retrieveByCredentials(#[\SensitiveParameter] array $credentials);

/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
* @param array $credentials
* @return bool
*/
Expand All @@ -50,7 +50,7 @@ public function validateCredentials(Authenticatable $user, #[\SensitiveParameter
/**
* Rehash the user's password if required and supported.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
* @param array $credentials
* @param bool $force
* @return void
Expand Down

0 comments on commit d2973fd

Please sign in to comment.