Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/_support/Entity/CustomUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ private function __construct(
) {
}

/**
* @param array<string, int|list<string>|string|Time|null> $data
*/
public static function reconstruct(array $data): static
{
return new self(
Expand Down
2 changes: 2 additions & 0 deletions tests/_support/Log/Handlers/TestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class TestHandler extends FileHandler

/**
* Where would the log be written?
*
* @param array<string, mixed> $config
*/
public function __construct(array $config)
{
Expand Down
3 changes: 3 additions & 0 deletions tests/_support/Models/EventModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ protected function afterDeleteMethod(array $data)
return $data;
}

/**
* @param array<string, mixed> $data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tests, I think mixed is allowed. For callbacks, there are types in BaseModel, if you've forgotten or simplified it on purpose.

And what about the other methods with arrays? afterFindMethod beforeDeleteMethod...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it use mixed item already, with string key.

This PR only change when there is an array dim fetch $param[key] in the method.

*/
protected function beforeFindMethod(array $data)
{
$this->tokens[] = 'beforeFind';
Expand Down
3 changes: 3 additions & 0 deletions tests/system/Database/Live/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public function testUpdateWithWhereAndLimit(): void
}
}

/**
* @param array<int, mixed> $expected
*/
#[DataProvider('provideUpdateBatch')]
public function testUpdateBatch(string $constraints, array $data, array $expected): void
{
Expand Down
3 changes: 3 additions & 0 deletions tests/system/HTTP/CURLRequestShareOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#[Group('Others')]
final class CURLRequestShareOptionsTest extends CURLRequestTest
{
/**
* @param array<string, mixed> $options
*/
protected function getRequest(array $options = []): MockCURLRequest
{
$uri = isset($options['baseURI']) ? new URI($options['baseURI']) : new URI();
Expand Down
3 changes: 3 additions & 0 deletions tests/system/Validation/StrictRules/CreditCardRulesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,9 @@ protected static function generateCardNumber(int $prefix, int $length): string
return implode('', $digits);
}

/**
* @param array<int, int|string> $digits
*/
protected static function calculateLuhnChecksum(array $digits, int $length): int
{
$parity = $length % 2;
Expand Down
2 changes: 1 addition & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 2790 errors
# total 2788 errors

includes:
- argument.type.neon
Expand Down
12 changes: 1 addition & 11 deletions utils/phpstan-baseline/missingType.iterableValue.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1378 errors
# total 1376 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -5612,11 +5612,6 @@ parameters:
count: 1
path: ../../tests/system/Database/Live/UpdateTest.php

-
message: '#^Method CodeIgniter\\Database\\Live\\UpdateTest\:\:testUpdateBatch\(\) has parameter \$expected with no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/Database/Live/UpdateTest.php

-
message: '#^Method CodeIgniter\\Debug\\ExceptionHandlerTest\:\:backupIniValues\(\) has parameter \$keys with no value type specified in iterable type array\.$#'
count: 1
Expand Down Expand Up @@ -6647,11 +6642,6 @@ parameters:
count: 1
path: ../../tests/system/Validation/RulesTest.php

-
message: '#^Method CodeIgniter\\Validation\\StrictRules\\CreditCardRulesTest\:\:calculateLuhnChecksum\(\) has parameter \$digits with no value type specified in iterable type array\.$#'
count: 1
path: ../../tests/system/Validation/StrictRules/CreditCardRulesTest.php

-
message: '#^Method CodeIgniter\\Validation\\StrictRules\\CreditCardRulesTest\:\:provideValidCCNumber\(\) return type has no value type specified in iterable type iterable\.$#'
count: 1
Expand Down
Loading