Skip to content

Commit 2f58a5d

Browse files
committed
refactor: use BaseException and HTTPException
1 parent 756f8dc commit 2f58a5d

6 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/Authentication/AuthenticationException.php

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

33
namespace CodeIgniter\Shield\Authentication;
44

5-
use CodeIgniter\HTTP\Exceptions\HTTPException;
6-
use Exception;
5+
use CodeIgniter\Shield\Exceptions\HTTPException;
76

8-
class AuthenticationException extends Exception
7+
class AuthenticationException extends HTTPException
98
{
109
protected $code = 403;
1110

src/Authentication/Passwords/PwnedValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace CodeIgniter\Shield\Authentication\Passwords;
44

55
use CodeIgniter\Config\Services;
6-
use CodeIgniter\HTTP\Exceptions\HTTPException;
76
use CodeIgniter\Shield\Authentication\AuthenticationException;
87
use CodeIgniter\Shield\Entities\User;
8+
use CodeIgniter\Shield\Exceptions\HTTPException;
99
use CodeIgniter\Shield\Result;
1010

1111
/**

src/Authorization/AuthorizationException.php

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

33
namespace CodeIgniter\Shield\Authorization;
44

5-
use Exception;
5+
use CodeIgniter\Shield\Exceptions\HTTPException;
66

7-
class AuthorizationException extends Exception
7+
class AuthorizationException extends HTTPException
88
{
99
protected $code = 401;
1010

src/Exceptions/LogicException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
namespace CodeIgniter\Shield\Exceptions;
44

5-
class LogicException extends \LogicException
5+
class LogicException extends \LogicException implements BaseException
66
{
77
}

src/Exceptions/RuntimeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
namespace CodeIgniter\Shield\Exceptions;
44

5-
class RuntimeException extends \RuntimeException
5+
class RuntimeException extends \RuntimeException implements BaseException
66
{
77
}

tests/Unit/PwnedValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Tests\Unit;
44

5-
use CodeIgniter\HTTP\Exceptions\HTTPException;
65
use CodeIgniter\HTTP\Response;
76
use CodeIgniter\Shield\Authentication\AuthenticationException;
87
use CodeIgniter\Shield\Authentication\Passwords\PwnedValidator;
98
use CodeIgniter\Shield\Config\Auth as AuthConfig;
109
use CodeIgniter\Shield\Config\Services;
10+
use CodeIgniter\Shield\Exceptions\HTTPException;
1111
use CodeIgniter\Test\CIUnitTestCase;
1212
use Config\App;
1313

0 commit comments

Comments
 (0)