Skip to content

Commit 6fc199b

Browse files
committed
Add compatibility for strict types
1 parent 4841326 commit 6fc199b

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

system/Debug/Toolbar.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
use CodeIgniter\Format\JSONFormatter;
1919
use CodeIgniter\Format\XMLFormatter;
2020
use CodeIgniter\HTTP\DownloadResponse;
21+
use CodeIgniter\HTTP\IncomingRequest;
2122
use CodeIgniter\HTTP\RequestInterface;
23+
use CodeIgniter\HTTP\Response;
2224
use CodeIgniter\HTTP\ResponseInterface;
2325
use Config\Services;
2426
use Config\Toolbar as ToolbarConfig;
@@ -84,6 +86,11 @@ public function __construct(ToolbarConfig $config)
8486
*/
8587
public function run(float $startTime, float $totalTime, RequestInterface $request, ResponseInterface $response): string
8688
{
89+
/**
90+
* @var IncomingRequest $request
91+
* @var Response $response
92+
*/
93+
8794
// Data items used within the view.
8895
$data['url'] = current_url();
8996
$data['method'] = $request->getMethod(true);
@@ -295,6 +302,11 @@ protected function roundTo(float $number, int $increments = 5): float
295302
*/
296303
public function prepare(RequestInterface $request = null, ResponseInterface $response = null)
297304
{
305+
/**
306+
* @var IncomingRequest $request
307+
* @var Response $response
308+
*/
309+
298310
if (CI_DEBUG && ! is_cli())
299311
{
300312
global $app;
@@ -437,8 +449,8 @@ protected function format(string $data, string $format = 'html'): string
437449
{
438450
$history = new History();
439451
$history->setFiles(
440-
Services::request()->getGet('debugbar_time'),
441-
$this->config->maxHistory
452+
(int) Services::request()->getGet('debugbar_time'),
453+
$this->config->maxHistory
442454
);
443455

444456
$data['collectors'][] = $history->getAsArray();

system/View/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ public function setDelimiters($leftDelimiter = '{', $rightDelimiter = '}'): Rend
566566
*
567567
* @return string
568568
*/
569-
protected function replaceSingle($pattern, $content, $template, bool $escape = false): string
569+
protected function replaceSingle($pattern, string $content, string $template, bool $escape = false): string
570570
{
571571
// Any dollar signs in the pattern will be misinterpreted, so slash them
572572
$pattern = addcslashes($pattern, '$');

0 commit comments

Comments
 (0)