Skip to content

Commit 993e05c

Browse files
authored
refactor: change $request to CLIRequest|IncomingRequest in API\ResponseTrait (#9658)
1 parent 59de29e commit 993e05c

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

system/API/ResponseTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515

1616
use CodeIgniter\Format\Format;
1717
use CodeIgniter\Format\FormatterInterface;
18+
use CodeIgniter\HTTP\CLIRequest;
1819
use CodeIgniter\HTTP\IncomingRequest;
19-
use CodeIgniter\HTTP\RequestInterface;
2020
use CodeIgniter\HTTP\ResponseInterface;
2121

2222
/**
2323
* Provides common, more readable, methods to provide
2424
* consistent HTTP responses under a variety of common
2525
* situations when working as an API.
2626
*
27-
* @property RequestInterface $request
28-
* @property ResponseInterface $response
29-
* @property bool $stringAsHtml Whether to treat string data as HTML in JSON response.
30-
* Setting `true` is only for backward compatibility.
27+
* @property CLIRequest|IncomingRequest $request
28+
* @property ResponseInterface $response
29+
* @property bool $stringAsHtml Whether to treat string data as HTML in JSON response.
30+
* Setting `true` is only for backward compatibility.
3131
*/
3232
trait ResponseTrait
3333
{

system/Debug/BaseExceptionHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace CodeIgniter\Debug;
1515

16+
use CodeIgniter\HTTP\CLIRequest;
17+
use CodeIgniter\HTTP\IncomingRequest;
1618
use CodeIgniter\HTTP\RequestInterface;
1719
use CodeIgniter\HTTP\ResponseInterface;
1820
use Config\Exceptions as ExceptionsConfig;
@@ -54,6 +56,8 @@ public function __construct(ExceptionsConfig $config)
5456
/**
5557
* The main entry point into the handler.
5658
*
59+
* @param CLIRequest|IncomingRequest $request
60+
*
5761
* @return void
5862
*/
5963
abstract public function handle(

system/Debug/ExceptionHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use CodeIgniter\API\ResponseTrait;
1717
use CodeIgniter\Exceptions\PageNotFoundException;
18+
use CodeIgniter\HTTP\CLIRequest;
1819
use CodeIgniter\HTTP\Exceptions\HTTPException;
1920
use CodeIgniter\HTTP\IncomingRequest;
2021
use CodeIgniter\HTTP\RequestInterface;
@@ -41,6 +42,8 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
4142

4243
/**
4344
* Determines the correct way to display the error.
45+
*
46+
* @param CLIRequest|IncomingRequest $request
4447
*/
4548
public function handle(
4649
Throwable $exception,

system/Debug/ExceptionHandlerInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace CodeIgniter\Debug;
1515

16+
use CodeIgniter\HTTP\CLIRequest;
17+
use CodeIgniter\HTTP\IncomingRequest;
1618
use CodeIgniter\HTTP\RequestInterface;
1719
use CodeIgniter\HTTP\ResponseInterface;
1820
use Throwable;
@@ -21,6 +23,8 @@ interface ExceptionHandlerInterface
2123
{
2224
/**
2325
* Determines the correct way to display the error.
26+
*
27+
* @param CLIRequest|IncomingRequest $request
2428
*/
2529
public function handle(
2630
Throwable $exception,

0 commit comments

Comments
 (0)