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 33namespace CodeIgniter \Shield \Authentication ;
44
55use CodeIgniter \HTTP \Exceptions \HTTPException ;
6- use Exception ;
6+ use CodeIgniter \ Shield \ Exceptions \ RuntimeException ;
77
8- class AuthenticationException extends Exception
8+ class AuthenticationException extends RuntimeException
99{
1010 protected $ code = 403 ;
1111
Original file line number Diff line number Diff line change 77use CodeIgniter \Shield \Authentication \AuthenticationException ;
88use CodeIgniter \Shield \Authentication \AuthenticatorInterface ;
99use CodeIgniter \Shield \Entities \User ;
10+ use CodeIgniter \Shield \Exceptions \InvalidArgumentException ;
1011use CodeIgniter \Shield \Models \TokenLoginModel ;
1112use CodeIgniter \Shield \Models \UserIdentityModel ;
1213use CodeIgniter \Shield \Models \UserModel ;
1314use CodeIgniter \Shield \Result ;
14- use InvalidArgumentException ;
1515
1616class AccessTokens implements AuthenticatorInterface
1717{
Original file line number Diff line number Diff line change 1313use CodeIgniter \Shield \Authentication \Passwords ;
1414use CodeIgniter \Shield \Entities \User ;
1515use CodeIgniter \Shield \Entities \UserIdentity ;
16+ use CodeIgniter \Shield \Exceptions \InvalidArgumentException ;
1617use CodeIgniter \Shield \Exceptions \LogicException ;
1718use CodeIgniter \Shield \Models \LoginModel ;
1819use CodeIgniter \Shield \Models \RememberModel ;
1920use CodeIgniter \Shield \Models \UserIdentityModel ;
2021use CodeIgniter \Shield \Models \UserModel ;
2122use CodeIgniter \Shield \Result ;
22- use Exception ;
23- use InvalidArgumentException ;
2423use stdClass ;
2524
2625class Session implements AuthenticatorInterface
@@ -812,8 +811,6 @@ public function recordActiveDate(): void
812811 * and stores the necessary info in the db and a cookie.
813812 *
814813 * @see https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence
815- *
816- * @throws Exception
817814 */
818815 protected function rememberUser (User $ user ): void
819816 {
Original file line number Diff line number Diff line change 22
33namespace CodeIgniter \Shield \Authorization ;
44
5- use Exception ;
5+ use CodeIgniter \ Shield \ Exceptions \ RuntimeException ;
66
7- class AuthorizationException extends Exception
7+ class AuthorizationException extends RuntimeException
88{
99 protected $ code = 401 ;
1010
Original file line number Diff line number Diff line change 33namespace CodeIgniter \Shield \Authorization ;
44
55use CodeIgniter \Shield \Entities \Group ;
6- use RuntimeException ;
6+ use CodeIgniter \ Shield \ Exceptions \ RuntimeException ;
77
88/**
99 * 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 22
33namespace CodeIgniter \Shield \Exceptions ;
44
5- class LogicException extends \LogicException
5+ class LogicException extends \LogicException implements BaseException
66{
77}
Original file line number Diff line number Diff line change 22
33namespace CodeIgniter \Shield \Exceptions ;
44
5- class RuntimeException extends \RuntimeException
5+ class RuntimeException extends \RuntimeException implements BaseException
66{
77}
Original file line number Diff line number Diff line change 77use CodeIgniter \Shield \Authentication \Authenticators \Session ;
88use CodeIgniter \Shield \Entities \Login ;
99use CodeIgniter \Shield \Entities \User ;
10- use Exception ;
1110use Faker \Generator ;
1211
1312class LoginModel extends Model
@@ -81,8 +80,6 @@ public function lastLogin(User $user): ?Login
8180
8281 /**
8382 * Generate a fake login for testing
84- *
85- * @throws Exception
8683 */
8784 public function fake (Generator &$ faker ): Login
8885 {
You can’t perform that action at this time.
0 commit comments