Skip to content

Commit 42801e7

Browse files
authored
docs: allow boolean values in the model for PHPStan (#9276)
* docs: add the type to row_array in model. * fix: fix the ignore.
1 parent 4ca4204 commit 42801e7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

phpstan-baseline.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -15777,13 +15777,13 @@
1577715777
];
1577815778
$ignoreErrors[] = [
1577915779
// identifier: argument.type
15780-
'message' => '#^Parameter \\#1 \\$row of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\) expects array\\<int\\|string, float\\|int\\|object\\|string\\|null\\>\\|object, array\\<string, array\\<int, string\\>\\> given\\.$#',
15780+
'message' => '#^Parameter \\#1 \\$row of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\) expects array<int\\|string, bool\\|float\\|int\\|object\\|string\\|null>\\|object, array<string, array<int, string>> given\\.$#',
1578115781
'count' => 1,
1578215782
'path' => __DIR__ . '/tests/system/Models/DataConverterModelTest.php',
1578315783
];
1578415784
$ignoreErrors[] = [
1578515785
// identifier: argument.type
15786-
'message' => '#^Parameter \\#2 \\$row of method CodeIgniter\\\\Model\\:\\:update\\(\\) expects array\\<int\\|string, float\\|int\\|object\\|string\\|null\\>\\|object\\|null, array\\<string, array\\<int, string\\>\\> given\\.$#',
15786+
'message' => '#^Parameter \\#2 \\$row of method CodeIgniter\\\\Model\\:\\:update\\(\\) expects array<int\\|string, bool\\|float\\|int\\|object\\|string\\|null>\\|object\\|null, array<string, array<int, string>> given\\.$#',
1578715787
'count' => 1,
1578815788
'path' => __DIR__ . '/tests/system/Models/DataConverterModelTest.php',
1578915789
];
@@ -16185,7 +16185,7 @@
1618516185
];
1618616186
$ignoreErrors[] = [
1618716187
// identifier: argument.type
16188-
'message' => '#^Parameter \\#1 \\$row of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\) expects array\\<int\\|string, float\\|int\\|object\\|string\\|null\\>\\|object, array\\<int, array\\>\\|null given\\.$#',
16188+
'message' => '#^Parameter \\#1 \\$row of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\) expects array<int\\|string, bool\\|float\\|int\\|object\\|string\\|null>\\|object, array<int, array>\\|null given\\.$#',
1618916189
'count' => 1,
1619016190
'path' => __DIR__ . '/tests/system/Models/UpdateModelTest.php',
1619116191
];

system/BaseModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* - process various callbacks
4747
* - allow intermingling calls to the db connection
4848
*
49-
* @phpstan-type row_array array<int|string, float|int|null|object|string>
49+
* @phpstan-type row_array array<int|string, float|int|null|object|string|bool>
5050
* @phpstan-type event_data_beforeinsert array{data: row_array}
5151
* @phpstan-type event_data_afterinsert array{id: int|string, data: row_array, result: bool}
5252
* @phpstan-type event_data_beforefind array{id?: int|string, method: string, singleton: bool, limit?: int, offset?: int}

0 commit comments

Comments
 (0)