refactor: add @throws RedirectException in Controller::initController (#9327)

This commit is contained in:
John Paul E. Balandan, CPA 2024-12-19 16:33:56 +08:00 committed by GitHub
parent 8fa419fdad
commit cc1b8f2856
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 11 deletions

View File

@ -15,6 +15,7 @@ namespace CodeIgniter;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\Exceptions\HTTPException;
use CodeIgniter\HTTP\Exceptions\RedirectException;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
@ -77,7 +78,7 @@ class Controller
*
* @return void
*
* @throws HTTPException
* @throws HTTPException|RedirectException
*/
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
@ -105,7 +106,7 @@ class Controller
*
* @return void
*
* @throws HTTPException
* @throws HTTPException|RedirectException
*/
protected function forceHTTPS(int $duration = 31_536_000)
{

View File

@ -1,8 +0,0 @@
# total 1 error
parameters:
ignoreErrors:
-
message: '#^Dead catch \- CodeIgniter\\HTTP\\Exceptions\\RedirectException is never thrown in the try block\.$#'
count: 1
path: ../../tests/system/ControllerTest.php

View File

@ -7,7 +7,6 @@ includes:
- booleanNot.exprNotBoolean.neon
- booleanOr.leftNotBoolean.neon
- booleanOr.rightNotBoolean.neon
- catch.neverThrown.neon
- class.notFound.neon
- codeigniter.cacheHandlerInstance.neon
- codeigniter.configArgumentInstanceof.neon