diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index 38e73bb9b661..d5e0c2ec7ee0 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -1,6 +1,5 @@ 1, 'path' => __DIR__ . '/tests/system/View/ParserTest.php', ]; -$ignoreErrors[] = [ - // identifier: missingType.iterableValue - 'message' => '#^Method class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/View/ParserTest.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#2 \\$context of method CodeIgniter\\\\View\\\\Parser\\:\\:setData\\(\\) expects \'attr\'\\|\'css\'\\|\'html\'\\|\'js\'\\|\'raw\'\\|\'url\'\\|null, \'unknown\' given\\.$#', @@ -18385,18 +18379,6 @@ 'count' => 1, 'path' => __DIR__ . '/tests/system/View/ParserTest.php', ]; -$ignoreErrors[] = [ - // identifier: missingType.property - 'message' => '#^Property class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:\\$bar has no type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/View/ParserTest.php', -]; -$ignoreErrors[] = [ - // identifier: missingType.property - 'message' => '#^Property class@anonymous/tests/system/View/ParserTest\\.php\\:340\\:\\:\\$foo has no type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/View/ParserTest.php', -]; $ignoreErrors[] = [ // identifier: method.notFound 'message' => '#^Call to an undefined method CodeIgniter\\\\View\\\\Table\\:\\:compileTemplate\\(\\)\\.$#', diff --git a/system/Exceptions/PageNotFoundException.php b/system/Exceptions/PageNotFoundException.php index 552c8fd1c924..1a3b27a76a87 100644 --- a/system/Exceptions/PageNotFoundException.php +++ b/system/Exceptions/PageNotFoundException.php @@ -13,7 +13,6 @@ namespace CodeIgniter\Exceptions; -use Config\Services; use OutOfBoundsException; class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface, HTTPExceptionInterface diff --git a/system/Log/Handlers/ChromeLoggerHandler.php b/system/Log/Handlers/ChromeLoggerHandler.php index 26fe0b6f9525..37c7c0ffeddf 100644 --- a/system/Log/Handlers/ChromeLoggerHandler.php +++ b/system/Log/Handlers/ChromeLoggerHandler.php @@ -155,7 +155,7 @@ protected function format($object) */ public function sendLogs(?ResponseInterface &$response = null) { - if ($response instanceof ResponseInterface) { + if (! $response instanceof ResponseInterface) { $response = service('response', null, true); } diff --git a/tests/system/Filters/DebugToolbarTest.php b/tests/system/Filters/DebugToolbarTest.php index e395f5ba200c..0826a04afca8 100644 --- a/tests/system/Filters/DebugToolbarTest.php +++ b/tests/system/Filters/DebugToolbarTest.php @@ -15,6 +15,7 @@ use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\IncomingRequest; +use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\Response; use CodeIgniter\Test\CIUnitTestCase; use Config\Filters as FilterConfig; @@ -31,7 +32,7 @@ final class DebugToolbarTest extends CIUnitTestCase /** * @var CLIRequest|IncomingRequest */ - private $request; + private RequestInterface $request; private Response $response; diff --git a/tests/system/Filters/HoneypotTest.php b/tests/system/Filters/HoneypotTest.php index 43d85094dd04..2d45b35a20b0 100644 --- a/tests/system/Filters/HoneypotTest.php +++ b/tests/system/Filters/HoneypotTest.php @@ -16,6 +16,7 @@ use CodeIgniter\Honeypot\Exceptions\HoneypotException; use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\IncomingRequest; +use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\Response; use CodeIgniter\Test\CIUnitTestCase; use Config\Honeypot; @@ -36,9 +37,9 @@ final class HoneypotTest extends CIUnitTestCase private Honeypot $honey; /** - * @var CLIRequest|IncomingRequest|null + * @var CLIRequest|IncomingRequest */ - private $request; + private RequestInterface $request; private ?Response $response = null; diff --git a/tests/system/Honeypot/HoneypotTest.php b/tests/system/Honeypot/HoneypotTest.php index fdcf198d7608..3878a5d957ff 100644 --- a/tests/system/Honeypot/HoneypotTest.php +++ b/tests/system/Honeypot/HoneypotTest.php @@ -18,6 +18,7 @@ use CodeIgniter\Honeypot\Exceptions\HoneypotException; use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\IncomingRequest; +use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\Response; use CodeIgniter\Test\CIUnitTestCase; use Config\App; @@ -38,7 +39,7 @@ final class HoneypotTest extends CIUnitTestCase /** * @var CLIRequest|IncomingRequest */ - private $request; + private RequestInterface $request; private Response $response; diff --git a/tests/system/View/ParserTest.php b/tests/system/View/ParserTest.php index 35e1a998f557..1c000cf40978 100644 --- a/tests/system/View/ParserTest.php +++ b/tests/system/View/ParserTest.php @@ -337,9 +337,12 @@ public function testParseNull(): void public function testParseLoopEntityProperties(): void { $power = new class () extends Entity { - public $foo = 'bar'; - protected $bar = 'baz'; + public string $foo = 'bar'; + protected string $bar = 'baz'; + /** + * @return array + */ public function toArray(bool $onlyChanged = false, bool $cast = true, bool $recursive = false): array { return [