Skip to content

refactor: change $request to CLIRequest|IncomingRequest in ResponseTrait #9658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions system/API/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@

use CodeIgniter\Format\Format;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;

/**
* Provides common, more readable, methods to provide
* consistent HTTP responses under a variety of common
* situations when working as an API.
*
* @property RequestInterface $request
* @property ResponseInterface $response
* @property bool $stringAsHtml Whether to treat string data as HTML in JSON response.
* Setting `true` is only for backward compatibility.
* @property CLIRequest|IncomingRequest $request
* @property ResponseInterface $response
* @property bool $stringAsHtml Whether to treat string data as HTML in JSON response.
* Setting `true` is only for backward compatibility.
*/
trait ResponseTrait
{
Expand Down
4 changes: 4 additions & 0 deletions system/Debug/BaseExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace CodeIgniter\Debug;

use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Config\Exceptions as ExceptionsConfig;
Expand Down Expand Up @@ -54,6 +56,8 @@ public function __construct(ExceptionsConfig $config)
/**
* The main entry point into the handler.
*
* @param CLIRequest|IncomingRequest $request
*
* @return void
*/
abstract public function handle(
Expand Down
3 changes: 3 additions & 0 deletions system/Debug/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use CodeIgniter\API\ResponseTrait;
use CodeIgniter\Exceptions\PageNotFoundException;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\Exceptions\HTTPException;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
Expand All @@ -41,6 +42,8 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa

/**
* Determines the correct way to display the error.
*
* @param CLIRequest|IncomingRequest $request
*/
public function handle(
Throwable $exception,
Expand Down
4 changes: 4 additions & 0 deletions system/Debug/ExceptionHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace CodeIgniter\Debug;

use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Throwable;
Expand All @@ -21,6 +23,8 @@ interface ExceptionHandlerInterface
{
/**
* Determines the correct way to display the error.
*
* @param CLIRequest|IncomingRequest $request
*/
public function handle(
Throwable $exception,
Expand Down
Loading