Skip to content

Commit c23fd8f

Browse files
committed
refactor: replace Authenticatable with User
1 parent 38cdc1a commit c23fd8f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Authentication/Passwords/CompositionValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace CodeIgniter\Shield\Authentication\Passwords;
44

55
use CodeIgniter\Shield\Authentication\AuthenticationException;
6-
use CodeIgniter\Shield\Interfaces\Authenticatable;
6+
use CodeIgniter\Shield\Entities\User;
77
use CodeIgniter\Shield\Result;
88

99
/**
@@ -24,7 +24,7 @@ class CompositionValidator extends BaseValidator implements ValidatorInterface
2424
* The password will be passed to any remaining validators.
2525
* False will immediately stop validation process
2626
*/
27-
public function check(string $password, ?Authenticatable $user = null): Result
27+
public function check(string $password, ?User $user = null): Result
2828
{
2929
if (empty($this->config->minimumPasswordLength)) {
3030
throw AuthenticationException::forUnsetPasswordLength();

src/Authentication/Passwords/DictionaryValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace CodeIgniter\Shield\Authentication\Passwords;
44

5-
use CodeIgniter\Shield\Interfaces\Authenticatable;
5+
use CodeIgniter\Shield\Entities\User;
66
use CodeIgniter\Shield\Result;
77

88
/**
@@ -19,7 +19,7 @@ class DictionaryValidator extends BaseValidator implements ValidatorInterface
1919
* If true is returned the password will be passed to next validator.
2020
* If false is returned the validation process will be immediately stopped.
2121
*/
22-
public function check(string $password, ?Authenticatable $user = null): Result
22+
public function check(string $password, ?User $user = null): Result
2323
{
2424
// Loop over our file
2525
$fp = fopen(__DIR__ . '/_dictionary.txt', 'rb');

src/Authentication/Passwords/PwnedValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use CodeIgniter\Config\Services;
66
use CodeIgniter\HTTP\Exceptions\HTTPException;
77
use CodeIgniter\Shield\Authentication\AuthenticationException;
8-
use CodeIgniter\Shield\Interfaces\Authenticatable;
8+
use CodeIgniter\Shield\Entities\User;
99
use CodeIgniter\Shield\Result;
1010

1111
/**
@@ -29,7 +29,7 @@ class PwnedValidator extends BaseValidator implements ValidatorInterface
2929
*
3030
* @throws AuthenticationException
3131
*/
32-
public function check(string $password, ?Authenticatable $user = null): Result
32+
public function check(string $password, ?User $user = null): Result
3333
{
3434
$hashedPword = strtoupper(sha1($password));
3535
$rangeHash = substr($hashedPword, 0, 5);

0 commit comments

Comments
 (0)