Skip to content

Commit d17cf02

Browse files
committed
refactor: use ::class constants
To fix psalm issues.
1 parent 579e0a2 commit d17cf02

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/Config/Auth.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
use CodeIgniter\Shield\Authentication\AuthenticatorInterface;
1010
use CodeIgniter\Shield\Authentication\Authenticators\AccessTokens;
1111
use CodeIgniter\Shield\Authentication\Authenticators\Session;
12+
use CodeIgniter\Shield\Authentication\Passwords\CompositionValidator;
13+
use CodeIgniter\Shield\Authentication\Passwords\DictionaryValidator;
14+
use CodeIgniter\Shield\Authentication\Passwords\NothingPersonalValidator;
15+
use CodeIgniter\Shield\Authentication\Passwords\PwnedValidator;
1216
use CodeIgniter\Shield\Authentication\Passwords\ValidatorInterface;
1317
use CodeIgniter\Shield\Models\UserModel;
1418

@@ -57,8 +61,8 @@ class Auth extends BaseConfig
5761
* You must register actions in the order of the actions to be performed.
5862
*
5963
* Available actions with Shield:
60-
* - register: 'CodeIgniter\Shield\Authentication\Actions\EmailActivator'
61-
* - login: 'CodeIgniter\Shield\Authentication\Actions\Email2FA'
64+
* - register: \CodeIgniter\Shield\Authentication\Actions\EmailActivator::class
65+
* - login: \CodeIgniter\Shield\Authentication\Actions\Email2FA::class
6266
*
6367
* @var array<string, class-string<ActionInterface>|null>
6468
*/
@@ -209,10 +213,10 @@ class Auth extends BaseConfig
209213
* @var class-string<ValidatorInterface>[]
210214
*/
211215
public array $passwordValidators = [
212-
'CodeIgniter\Shield\Authentication\Passwords\CompositionValidator',
213-
'CodeIgniter\Shield\Authentication\Passwords\NothingPersonalValidator',
214-
'CodeIgniter\Shield\Authentication\Passwords\DictionaryValidator',
215-
// 'CodeIgniter\Shield\Authentication\Passwords\PwnedValidator',
216+
CompositionValidator::class,
217+
NothingPersonalValidator::class,
218+
DictionaryValidator::class,
219+
// PwnedValidator::class,
216220
];
217221

218222
/**
@@ -333,7 +337,7 @@ class Auth extends BaseConfig
333337
*
334338
* @var class-string<UserModel>
335339
*/
336-
public string $userProvider = 'CodeIgniter\Shield\Models\UserModel';
340+
public string $userProvider = UserModel::class;
337341

338342
/**
339343
* Returns the URL that a user should be redirected

0 commit comments

Comments
 (0)