/**
* Setup a Request object to use so that CodeIgniter
* won't try to auto-populate some of the items.
*/
protected function setupRequest(string
$method, ?string
$path = null
): IncomingRequest
{ $config =
config(App::
class);
$uri =
new URI(rtrim($config->baseURL, '/'
) . '/' .
trim($path, '/ '
));
$request =
new IncomingRequest($config,
clone $uri, null,
new UserAgent());
$request->uri =
$uri;
$request->
setMethod($method);
$request->
setProtocolVersion('1.1'
);
if ($config->forceGlobalSecureRequests
) { $_SERVER['HTTPS'
] = 'test';
} return $request;
}