Skip to content

Commit ed0668b

Browse files
committed
refactor: add array<> param docblock on tests/ based on array dim fetch
1 parent 3f3df0d commit ed0668b

File tree

8 files changed

+19
-12
lines changed

8 files changed

+19
-12
lines changed

tests/_support/Entity/CustomUser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ private function __construct(
3838
) {
3939
}
4040

41+
/**
42+
* @param array<string, int|list<string>|string|Time|null> $data
43+
*/
4144
public static function reconstruct(array $data): static
4245
{
4346
return new self(

tests/_support/Log/Handlers/TestHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class TestHandler extends FileHandler
3535

3636
/**
3737
* Where would the log be written?
38+
*
39+
* @param array<string, mixed> $config
3840
*/
3941
public function __construct(array $config)
4042
{

tests/_support/Models/EventModel.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ protected function afterDeleteMethod(array $data)
129129
return $data;
130130
}
131131

132+
/**
133+
* @param array<string, mixed> $data
134+
*/
132135
protected function beforeFindMethod(array $data)
133136
{
134137
$this->tokens[] = 'beforeFind';

tests/system/Database/Live/UpdateTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ public function testUpdateWithWhereAndLimit(): void
114114
}
115115
}
116116

117+
/**
118+
* @param array<int, mixed> $expected
119+
*/
117120
#[DataProvider('provideUpdateBatch')]
118121
public function testUpdateBatch(string $constraints, array $data, array $expected): void
119122
{

tests/system/HTTP/CURLRequestShareOptionsTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#[Group('Others')]
2929
final class CURLRequestShareOptionsTest extends CURLRequestTest
3030
{
31+
/**
32+
* @param array<string, mixed> $options
33+
*/
3134
protected function getRequest(array $options = []): MockCURLRequest
3235
{
3336
$uri = isset($options['baseURI']) ? new URI($options['baseURI']) : new URI();

tests/system/Validation/StrictRules/CreditCardRulesTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,9 @@ protected static function generateCardNumber(int $prefix, int $length): string
12261226
return implode('', $digits);
12271227
}
12281228

1229+
/**
1230+
* @param array<int, int|string> $digits
1231+
*/
12291232
protected static function calculateLuhnChecksum(array $digits, int $length): int
12301233
{
12311234
$parity = $length % 2;

utils/phpstan-baseline/loader.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 2790 errors
1+
# total 2788 errors
22

33
includes:
44
- argument.type.neon

utils/phpstan-baseline/missingType.iterableValue.neon

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 1378 errors
1+
# total 1376 errors
22

33
parameters:
44
ignoreErrors:
@@ -5612,11 +5612,6 @@ parameters:
56125612
count: 1
56135613
path: ../../tests/system/Database/Live/UpdateTest.php
56145614

5615-
-
5616-
message: '#^Method CodeIgniter\\Database\\Live\\UpdateTest\:\:testUpdateBatch\(\) has parameter \$expected with no value type specified in iterable type array\.$#'
5617-
count: 1
5618-
path: ../../tests/system/Database/Live/UpdateTest.php
5619-
56205615
-
56215616
message: '#^Method CodeIgniter\\Debug\\ExceptionHandlerTest\:\:backupIniValues\(\) has parameter \$keys with no value type specified in iterable type array\.$#'
56225617
count: 1
@@ -6647,11 +6642,6 @@ parameters:
66476642
count: 1
66486643
path: ../../tests/system/Validation/RulesTest.php
66496644

6650-
-
6651-
message: '#^Method CodeIgniter\\Validation\\StrictRules\\CreditCardRulesTest\:\:calculateLuhnChecksum\(\) has parameter \$digits with no value type specified in iterable type array\.$#'
6652-
count: 1
6653-
path: ../../tests/system/Validation/StrictRules/CreditCardRulesTest.php
6654-
66556645
-
66566646
message: '#^Method CodeIgniter\\Validation\\StrictRules\\CreditCardRulesTest\:\:provideValidCCNumber\(\) return type has no value type specified in iterable type iterable\.$#'
66576647
count: 1

0 commit comments

Comments
 (0)