From 72c92e0dcb6ae3c691bd8e1b115e8fd5ea598622 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 3 Aug 2024 10:13:27 +0900 Subject: [PATCH] test: add @var for PHPStan --- phpstan-baseline.php | 18 ------------------ tests/system/ControllerTest.php | 10 ++++++++++ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index c49b156548eb..2fd4d79af642 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -12955,24 +12955,6 @@ 'count' => 1, 'path' => __DIR__ . '/tests/system/ControllerTest.php', ]; -$ignoreErrors[] = [ - // identifier: missingType.property - 'message' => '#^Property class@anonymous/tests/system/ControllerTest\\.php\\:128\\:\\:\\$signup has no type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/ControllerTest.php', -]; -$ignoreErrors[] = [ - // identifier: missingType.property - 'message' => '#^Property class@anonymous/tests/system/ControllerTest\\.php\\:128\\:\\:\\$signup_errors has no type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/ControllerTest.php', -]; -$ignoreErrors[] = [ - // identifier: missingType.property - 'message' => '#^Property class@anonymous/tests/system/ControllerTest\\.php\\:151\\:\\:\\$signup has no type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/ControllerTest.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#1 \\$cookies of class CodeIgniter\\\\Cookie\\\\CookieStore constructor expects array\\, array\\ given\\.$#', diff --git a/tests/system/ControllerTest.php b/tests/system/ControllerTest.php index c28de171d85b..add07fc20dd4 100644 --- a/tests/system/ControllerTest.php +++ b/tests/system/ControllerTest.php @@ -126,9 +126,16 @@ public function testValidateWithStringRulesNotFound(): void public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig(): void { $validation = new class () extends ValidationConfig { + /** + * @var array + */ public array $signup = [ 'username' => 'required', ]; + + /** + * @var array> + */ public array $signup_errors = [ 'username' => [ 'required' => 'You must choose a username.', @@ -149,6 +156,9 @@ public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig public function testValidateWithStringRulesFoundUseMessagesParameter(): void { $validation = new class () extends ValidationConfig { + /** + * @var array + */ public array $signup = [ 'username' => 'required', ];