Skip to content

Commit 72c92e0

Browse files
committed
test: add @var for PHPStan
1 parent c408acf commit 72c92e0

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12955,24 +12955,6 @@
1295512955
'count' => 1,
1295612956
'path' => __DIR__ . '/tests/system/ControllerTest.php',
1295712957
];
12958-
$ignoreErrors[] = [
12959-
// identifier: missingType.property
12960-
'message' => '#^Property class@anonymous/tests/system/ControllerTest\\.php\\:128\\:\\:\\$signup has no type specified\\.$#',
12961-
'count' => 1,
12962-
'path' => __DIR__ . '/tests/system/ControllerTest.php',
12963-
];
12964-
$ignoreErrors[] = [
12965-
// identifier: missingType.property
12966-
'message' => '#^Property class@anonymous/tests/system/ControllerTest\\.php\\:128\\:\\:\\$signup_errors has no type specified\\.$#',
12967-
'count' => 1,
12968-
'path' => __DIR__ . '/tests/system/ControllerTest.php',
12969-
];
12970-
$ignoreErrors[] = [
12971-
// identifier: missingType.property
12972-
'message' => '#^Property class@anonymous/tests/system/ControllerTest\\.php\\:151\\:\\:\\$signup has no type specified\\.$#',
12973-
'count' => 1,
12974-
'path' => __DIR__ . '/tests/system/ControllerTest.php',
12975-
];
1297612958
$ignoreErrors[] = [
1297712959
// identifier: argument.type
1297812960
'message' => '#^Parameter \\#1 \\$cookies of class CodeIgniter\\\\Cookie\\\\CookieStore constructor expects array\\<CodeIgniter\\\\Cookie\\\\Cookie\\>, array\\<int, DateTimeImmutable\\> given\\.$#',

tests/system/ControllerTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,16 @@ public function testValidateWithStringRulesNotFound(): void
126126
public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig(): void
127127
{
128128
$validation = new class () extends ValidationConfig {
129+
/**
130+
* @var array<string, string>
131+
*/
129132
public array $signup = [
130133
'username' => 'required',
131134
];
135+
136+
/**
137+
* @var array<string, array<string, string>>
138+
*/
132139
public array $signup_errors = [
133140
'username' => [
134141
'required' => 'You must choose a username.',
@@ -149,6 +156,9 @@ public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig
149156
public function testValidateWithStringRulesFoundUseMessagesParameter(): void
150157
{
151158
$validation = new class () extends ValidationConfig {
159+
/**
160+
* @var array<string, string>
161+
*/
152162
public array $signup = [
153163
'username' => 'required',
154164
];

0 commit comments

Comments
 (0)