Skip to content
Open
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
8 changes: 4 additions & 4 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Parameter #1 $credentials (array{token?: string, ...}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\JWT::attempt() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::attempt()',
'rawMessage' => 'Parameter #1 $credentials (array{token?: string}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\JWT::attempt() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::attempt()',
'identifier' => 'method.childParameterType',
'count' => 1,
'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Parameter #1 $credentials (array{token?: string, ...}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\JWT::check() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::check()',
'rawMessage' => 'Parameter #1 $credentials (array{token?: string}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\JWT::check() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::check()',
'identifier' => 'method.childParameterType',
'count' => 1,
'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php',
Expand Down Expand Up @@ -110,13 +110,13 @@
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Parameter #1 $credentials (array{email?: string, username?: string, password?: string, ...}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\Session::attempt() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::attempt()',
'rawMessage' => 'Parameter #1 $credentials (array{email?: string, username?: string, password?: string, ...<string, string>}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\Session::attempt() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::attempt()',
'identifier' => 'method.childParameterType',
'count' => 1,
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Parameter #1 $credentials (array{email?: string, username?: string, password?: string, ...}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\Session::check() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::check()',
'rawMessage' => 'Parameter #1 $credentials (array{email?: string, username?: string, password?: string, ...<string, string>}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\Session::check() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::check()',
'identifier' => 'method.childParameterType',
'count' => 1,
'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php',
Expand Down
10 changes: 5 additions & 5 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
/**
* Facade for Authentication
*
* @method Result attempt(array{email?: string, username?: string, password?: string, token?: string, ...} $credentials)
* @method Result check(array{email?: string, username?: string, password?: string, token?: string, ...} $credentials)
* @method bool checkAction(string $token, string $type) [Session]
* @method void forget(?User $user = null) [Session]
* @method Result attempt(array{email?: string, username?: string, password?: string, token?: string, ...<string, string>} $credentials)
* @method Result check(array{email?: string, username?: string, password?: string, token?: string, ...<string, string>} $credentials)
* @method bool checkAction(string $token, string $type) [Session]
* @method void forget(?User $user = null) [Session]
* @method User|null getUser()
* @method bool loggedIn()
* @method bool login(User $user)
* @method void loginById($userId)
* @method bool logout()
* @method void recordActiveDate()
* @method $this remember(bool $shouldRemember = true) [Session]
* @method $this remember(bool $shouldRemember = true) [Session]
*/
class Auth
{
Expand Down
4 changes: 2 additions & 2 deletions src/Authentication/Authenticators/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct(
* Attempts to authenticate a user with the given $credentials.
* Logs the user in with a successful check.
*
* @param array{token?: string, ...} $credentials
* @param array{token?: string} $credentials
*/
public function attempt(array $credentials): Result
{
Expand Down Expand Up @@ -141,7 +141,7 @@ public function attempt(array $credentials): Result
* In this case, $credentials has only a single valid value: token,
* which is the plain text token to return.
*
* @param array{token?: string, ...} $credentials
* @param array{token?: string} $credentials
*/
public function check(array $credentials): Result
{
Expand Down
4 changes: 2 additions & 2 deletions src/Authentication/Authenticators/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function remember(bool $shouldRemember = true): self
* Attempts to authenticate a user with the given $credentials.
* Logs the user in with a successful check.
*
* @phpstan-param array{email?: string, username?: string, password?: string, ...} $credentials
* @phpstan-param array{email?: string, username?: string, password?: string, ...<string, string>} $credentials
*/
public function attempt(array $credentials): Result
{
Expand Down Expand Up @@ -315,7 +315,7 @@ private function recordLoginAttempt(
* Checks a user's $credentials to see if they match an
* existing user.
*
* @phpstan-param array{email?: string, username?: string, password?: string, ...} $credentials
* @phpstan-param array{email?: string, username?: string, password?: string, ...<string, string>} $credentials
*/
public function check(array $credentials): Result
{
Expand Down
Loading