File tree Expand file tree Collapse file tree 12 files changed +29
-20
lines changed Expand file tree Collapse file tree 12 files changed +29
-20
lines changed Original file line number Diff line number Diff line change 3
3
namespace CodeIgniter \Shield \Authentication ;
4
4
5
5
use CodeIgniter \HTTP \Exceptions \HTTPException ;
6
- use Exception ;
6
+ use CodeIgniter \ Shield \ Exceptions \ RuntimeException ;
7
7
8
- class AuthenticationException extends Exception
8
+ class AuthenticationException extends RuntimeException
9
9
{
10
10
protected $ code = 403 ;
11
11
Original file line number Diff line number Diff line change 7
7
use CodeIgniter \Shield \Authentication \AuthenticationException ;
8
8
use CodeIgniter \Shield \Authentication \AuthenticatorInterface ;
9
9
use CodeIgniter \Shield \Entities \User ;
10
+ use CodeIgniter \Shield \Exceptions \InvalidArgumentException ;
10
11
use CodeIgniter \Shield \Models \TokenLoginModel ;
11
12
use CodeIgniter \Shield \Models \UserIdentityModel ;
12
13
use CodeIgniter \Shield \Models \UserModel ;
13
14
use CodeIgniter \Shield \Result ;
14
- use InvalidArgumentException ;
15
15
16
16
class AccessTokens implements AuthenticatorInterface
17
17
{
Original file line number Diff line number Diff line change 13
13
use CodeIgniter \Shield \Authentication \Passwords ;
14
14
use CodeIgniter \Shield \Entities \User ;
15
15
use CodeIgniter \Shield \Entities \UserIdentity ;
16
+ use CodeIgniter \Shield \Exceptions \InvalidArgumentException ;
16
17
use CodeIgniter \Shield \Exceptions \LogicException ;
17
18
use CodeIgniter \Shield \Models \LoginModel ;
18
19
use CodeIgniter \Shield \Models \RememberModel ;
19
20
use CodeIgniter \Shield \Models \UserIdentityModel ;
20
21
use CodeIgniter \Shield \Models \UserModel ;
21
22
use CodeIgniter \Shield \Result ;
22
- use Exception ;
23
- use InvalidArgumentException ;
24
23
use stdClass ;
25
24
26
25
class Session implements AuthenticatorInterface
@@ -812,8 +811,6 @@ public function recordActiveDate(): void
812
811
* and stores the necessary info in the db and a cookie.
813
812
*
814
813
* @see https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence
815
- *
816
- * @throws Exception
817
814
*/
818
815
protected function rememberUser (User $ user ): void
819
816
{
Original file line number Diff line number Diff line change 2
2
3
3
namespace CodeIgniter \Shield \Authorization ;
4
4
5
- use Exception ;
5
+ use CodeIgniter \ Shield \ Exceptions \ RuntimeException ;
6
6
7
- class AuthorizationException extends Exception
7
+ class AuthorizationException extends RuntimeException
8
8
{
9
9
protected $ code = 401 ;
10
10
Original file line number Diff line number Diff line change 3
3
namespace CodeIgniter \Shield \Authorization ;
4
4
5
5
use CodeIgniter \Shield \Entities \Group ;
6
- use RuntimeException ;
6
+ use CodeIgniter \ Shield \ Exceptions \ RuntimeException ;
7
7
8
8
/**
9
9
* Provides utility feature for working with
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace CodeIgniter \Shield \Exceptions ;
4
+
5
+ use Throwable ;
6
+
7
+ /**
8
+ * Base Exception Interface for Shield
9
+ */
10
+ interface BaseException extends Throwable
11
+ {
12
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace CodeIgniter \Shield \Exceptions ;
4
+
5
+ class InvalidArgumentException extends LogicException implements BaseException
6
+ {
7
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace CodeIgniter \Shield \Exceptions ;
4
4
5
- class LogicException extends \LogicException
5
+ class LogicException extends \LogicException implements BaseException
6
6
{
7
7
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace CodeIgniter \Shield \Exceptions ;
4
4
5
- class RuntimeException extends \RuntimeException
5
+ class RuntimeException extends \RuntimeException implements BaseException
6
6
{
7
7
}
Original file line number Diff line number Diff line change 7
7
use CodeIgniter \Shield \Authentication \Authenticators \Session ;
8
8
use CodeIgniter \Shield \Entities \Login ;
9
9
use CodeIgniter \Shield \Entities \User ;
10
- use Exception ;
11
10
use Faker \Generator ;
12
11
13
12
class LoginModel extends Model
@@ -81,8 +80,6 @@ public function lastLogin(User $user): ?Login
81
80
82
81
/**
83
82
* Generate a fake login for testing
84
- *
85
- * @throws Exception
86
83
*/
87
84
public function fake (Generator &$ faker ): Login
88
85
{
You can’t perform that action at this time.
0 commit comments