Skip to content

Commit ea38947

Browse files
committed
fix: Update the typing
1 parent 583e7b6 commit ea38947

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
@@ -18361,12 +18361,6 @@
1836118361
'count' => 1,
1836218362
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
1836318363
];
18364-
$ignoreErrors[] = [
18365-
// identifier: missingType.iterableValue
18366-
'message' => '#^Method class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#',
18367-
'count' => 1,
18368-
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
18369-
];
1837018364
$ignoreErrors[] = [
1837118365
// identifier: argument.type
1837218366
'message' => '#^Parameter \\#2 \\$context of method CodeIgniter\\\\View\\\\Parser\\:\\:setData\\(\\) expects \'attr\'\\|\'css\'\\|\'html\'\\|\'js\'\\|\'raw\'\\|\'url\'\\|null, \'unknown\' given\\.$#',
@@ -18379,18 +18373,6 @@
1837918373
'count' => 1,
1838018374
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
1838118375
];
18382-
$ignoreErrors[] = [
18383-
// identifier: missingType.property
18384-
'message' => '#^Property class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:\\$bar has no type specified\\.$#',
18385-
'count' => 1,
18386-
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
18387-
];
18388-
$ignoreErrors[] = [
18389-
// identifier: missingType.property
18390-
'message' => '#^Property class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:\\$foo has no type specified\\.$#',
18391-
'count' => 1,
18392-
'path' => __DIR__ . '/tests/system/View/ParserTest.php',
18393-
];
1839418376
$ignoreErrors[] = [
1839518377
// identifier: method.notFound
1839618378
'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)