Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] fix: intersect Authenticatable with Model in UserProvider phpdocs #54061

Draft
wants to merge 1 commit into
base: 11.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading