Skip to content

Commit ac0b7db

Browse files
committed
fix: Update the typing
1 parent 6ccda8a commit ac0b7db

File tree

8 files changed

+13
-27
lines changed

8 files changed

+13
-27
lines changed

app/Views/errors/html/error_exception.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
use CodeIgniter\HTTP\Header;
3-
use Config\Services;
43
use CodeIgniter\CodeIgniter;
54

65
$errorId = uniqid('error', true);

phpstan-baseline.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18367,12 +18367,6 @@
1836718367
'count' => 1,
1836818368
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
1836918369
];
18370-
$ignoreErrors[] = [
18371-
// identifier: missingType.iterableValue
18372-
'message' => '#^Method class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#',
18373-
'count' => 1,
18374-
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
18375-
];
1837618370
$ignoreErrors[] = [
1837718371
// identifier: argument.type
1837818372
'message' => '#^Parameter \\#2 \\$context of method CodeIgniter\\\\View\\\\Parser\\:\\:setData\\(\\) expects \'attr\'\\|\'css\'\\|\'html\'\\|\'js\'\\|\'raw\'\\|\'url\'\\|null, \'unknown\' given\\.$#',
@@ -18385,18 +18379,6 @@
1838518379
'count' => 1,
1838618380
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
1838718381
];
18388-
$ignoreErrors[] = [
18389-
// identifier: missingType.property
18390-
'message' => '#^Property class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:\\$bar has no type specified\\.$#',
18391-
'count' => 1,
18392-
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
18393-
];
18394-
$ignoreErrors[] = [
18395-
// identifier: missingType.property
18396-
'message' => '#^Property class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:\\$foo has no type specified\\.$#',
18397-
'count' => 1,
18398-
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
18399-
];
1840018382
$ignoreErrors[] = [
1840118383
// identifier: method.notFound
1840218384
'message' => '#^Call to an undefined method CodeIgniter\\\\View\\\\Table\\:\\:compileTemplate\\(\\)\\.$#',

system/Exceptions/PageNotFoundException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace CodeIgniter\Exceptions;
1515

16-
use Config\Services;
1716
use OutOfBoundsException;
1817

1918
class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface, HTTPExceptionInterface

system/Log/Handlers/ChromeLoggerHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ protected function format($object)
155155
*/
156156
public function sendLogs(?ResponseInterface &$response = null)
157157
{
158-
if ($response instanceof ResponseInterface) {
158+
if (! $response instanceof ResponseInterface) {
159159
$response = service('response', null, true);
160160
}
161161

tests/system/Filters/DebugToolbarTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use CodeIgniter\HTTP\CLIRequest;
1717
use CodeIgniter\HTTP\IncomingRequest;
18+
use CodeIgniter\HTTP\RequestInterface;
1819
use CodeIgniter\HTTP\Response;
1920
use CodeIgniter\Test\CIUnitTestCase;
2021
use Config\Filters as FilterConfig;
@@ -31,7 +32,7 @@ final class DebugToolbarTest extends CIUnitTestCase
3132
/**
3233
* @var CLIRequest|IncomingRequest
3334
*/
34-
private $request;
35+
private RequestInterface $request;
3536

3637
private Response $response;
3738

tests/system/Filters/HoneypotTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use CodeIgniter\Honeypot\Exceptions\HoneypotException;
1717
use CodeIgniter\HTTP\CLIRequest;
1818
use CodeIgniter\HTTP\IncomingRequest;
19+
use CodeIgniter\HTTP\RequestInterface;
1920
use CodeIgniter\HTTP\Response;
2021
use CodeIgniter\Test\CIUnitTestCase;
2122
use Config\Honeypot;
@@ -36,9 +37,9 @@ final class HoneypotTest extends CIUnitTestCase
3637
private Honeypot $honey;
3738

3839
/**
39-
* @var CLIRequest|IncomingRequest|null
40+
* @var CLIRequest|IncomingRequest
4041
*/
41-
private $request;
42+
private RequestInterface $request;
4243

4344
private ?Response $response = null;
4445

tests/system/Honeypot/HoneypotTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use CodeIgniter\Honeypot\Exceptions\HoneypotException;
1919
use CodeIgniter\HTTP\CLIRequest;
2020
use CodeIgniter\HTTP\IncomingRequest;
21+
use CodeIgniter\HTTP\RequestInterface;
2122
use CodeIgniter\HTTP\Response;
2223
use CodeIgniter\Test\CIUnitTestCase;
2324
use Config\App;
@@ -38,7 +39,7 @@ final class HoneypotTest extends CIUnitTestCase
3839
/**
3940
* @var CLIRequest|IncomingRequest
4041
*/
41-
private $request;
42+
private RequestInterface $request;
4243

4344
private Response $response;
4445

tests/system/View/ParserTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,12 @@ public function testParseNull(): void
337337
public function testParseLoopEntityProperties(): void
338338
{
339339
$power = new class () extends Entity {
340-
public $foo = 'bar';
341-
protected $bar = 'baz';
340+
public string $foo = 'bar';
341+
protected string $bar = 'baz';
342342

343+
/**
344+
* @return array<string, mixed>
345+
*/
343346
public function toArray(bool $onlyChanged = false, bool $cast = true, bool $recursive = false): array
344347
{
345348
return [

0 commit comments

Comments
 (0)