docs: fix PHPDoc types in BaseModel

This commit is contained in:
kenjis 2024-03-29 22:22:12 +09:00
parent 3503b4d461
commit f54cdde5aa
No known key found for this signature in database
GPG Key ID: BD254878922AF198
2 changed files with 6 additions and 48 deletions

View File

@ -226,11 +226,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/BaseModel.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:setValidationRules\\(\\) has parameter \\$validationRules with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/BaseModel.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:transformDataToArray\\(\\) return type has no value type specified in iterable type array\\.$#',
'count' => 1,
@ -11391,16 +11386,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/tests/_support/Models/UserModel.php',
];
$ignoreErrors[] = [
'message' => '#^Property Tests\\\\Support\\\\Models\\\\ValidErrorsModel\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, array\\<int\\|string, array\\<string, string\\>\\|string\\>\\|string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/_support/Models/ValidErrorsModel.php',
];
$ignoreErrors[] = [
'message' => '#^Property Tests\\\\Support\\\\Models\\\\ValidModel\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, array\\<int, string\\>\\|string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/_support/Models/ValidModel.php',
];
$ignoreErrors[] = [
'message' => '#^Property Tests\\\\Support\\\\SomeEntity\\:\\:\\$attributes type has no value type specified in iterable type array\\.$#',
'count' => 1,
@ -16301,41 +16286,11 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/UpdateModelTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelRuleGroupTest\\.php\\:368\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelRuleGroupTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelRuleGroupTest\\.php\\:406\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelRuleGroupTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelRuleGroupTest\\.php\\:446\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelRuleGroupTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelTest\\.php\\:243\\:\\:\\$grouptest has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelTest\\.php\\:380\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelTest\\.php\\:418\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelTest.php',
];
$ignoreErrors[] = [
'message' => '#^Property class@anonymous/tests/system/Models/ValidationModelTest\\.php\\:458\\:\\:\\$validationRules \\(array\\<int, string\\>\\|string\\) does not accept default value of type array\\<string, string\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/ValidationModelTest.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot access property \\$key on array\\.$#',
'count' => 7,

View File

@ -173,11 +173,14 @@ abstract class BaseModel
protected $db;
/**
* Rules used to validate data in insert, update, and save methods.
* Rules used to validate data in insert(), update(), and save() methods.
*
* The array must match the format of data passed to the Validation
* library.
*
* @var list<string>|string
* @see https://codeigniter4.github.io/userguide/models/model.html#setting-validation-rules
*
* @var array<string, array<string, array<string, string>|string>|string>|string
*/
protected $validationRules = [];
@ -1448,7 +1451,7 @@ abstract class BaseModel
* Allows to set (and reset) validation rules.
* It could be used when you have to change default or override current validate rules.
*
* @param array $validationRules Value
* @param array<string, array<string, array<string, string>|string>|string> $validationRules Value
*
* @return $this
*/