Skip to content

Commit 8dc3f13

Browse files
committed
fix: [BC] fix param types
1 parent f0ef14b commit 8dc3f13

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

system/CodeIgniter.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class CodeIgniter
8080
/**
8181
* Current request.
8282
*
83-
* @var CLIRequest|IncomingRequest|Request
83+
* @var CLIRequest|IncomingRequest
8484
*/
8585
protected $request;
8686

@@ -446,7 +446,7 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
446446
return $returnResponse ? $possibleResponse : $possibleResponse->pretend($this->useSafeOutput)->send();
447447
}
448448

449-
if ($possibleResponse instanceof Request) {
449+
if ($possibleResponse instanceof IncomingRequest) {
450450
$this->request = $possibleResponse;
451451
}
452452
}
@@ -574,9 +574,11 @@ protected function startBenchmark()
574574
* Sets a Request object to be used for this request.
575575
* Used when running certain tests.
576576
*
577+
* @param CLIRequest|IncomingRequest $request
578+
*
577579
* @return $this
578580
*/
579-
public function setRequest(Request $request)
581+
public function setRequest($request)
580582
{
581583
$this->request = $request;
582584

system/Test/FeatureTestCase.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ protected function setupHeaders(IncomingRequest $request)
342342
*
343343
* @throws ReflectionException
344344
*
345-
* @return Request
345+
* @return IncomingRequest
346346
*/
347-
protected function populateGlobals(string $method, Request $request, ?array $params = null)
347+
protected function populateGlobals(string $method, IncomingRequest $request, ?array $params = null)
348348
{
349349
// $params should set the query vars if present,
350350
// otherwise set it from the URL.
@@ -371,8 +371,10 @@ protected function populateGlobals(string $method, Request $request, ?array $par
371371
*
372372
* @param array|null $params The parameters to be formatted and put in the body. If this is empty, it will get the
373373
* what has been loaded into the request global of the request class.
374+
*
375+
* @return IncomingRequest
374376
*/
375-
protected function setRequestBody(Request $request, ?array $params = null): Request
377+
protected function setRequestBody(IncomingRequest $request, ?array $params = null): Request
376378
{
377379
if (isset($this->requestBody) && $this->requestBody !== '') {
378380
$request->setBody($this->requestBody);

0 commit comments

Comments
 (0)