Skip to content

Commit

Permalink
docs: allow boolean values in the model for PHPStan (#9276)
Browse files Browse the repository at this point in the history
* docs: add the type to row_array in model.

* fix: fix the ignore.
  • Loading branch information
ping-yee authored Nov 17, 2024
1 parent 4ca4204 commit 42801e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -15777,13 +15777,13 @@
];
$ignoreErrors[] = [
// identifier: argument.type
'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\\.$#',
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/DataConverterModelTest.php',
];
$ignoreErrors[] = [
// identifier: argument.type
'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\\.$#',
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/DataConverterModelTest.php',
];
Expand Down Expand Up @@ -16185,7 +16185,7 @@
];
$ignoreErrors[] = [
// identifier: argument.type
'message' => '#^Parameter \\#1 \\$row of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\) expects array\\<int\\|string, float\\|int\\|object\\|string\\|null\\>\\|object, array\\<int, array\\>\\|null given\\.$#',
'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\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/Models/UpdateModelTest.php',
];
Expand Down
2 changes: 1 addition & 1 deletion system/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* - process various callbacks
* - allow intermingling calls to the db connection
*
* @phpstan-type row_array array<int|string, float|int|null|object|string>
* @phpstan-type row_array array<int|string, float|int|null|object|string|bool>
* @phpstan-type event_data_beforeinsert array{data: row_array}
* @phpstan-type event_data_afterinsert array{id: int|string, data: row_array, result: bool}
* @phpstan-type event_data_beforefind array{id?: int|string, method: string, singleton: bool, limit?: int, offset?: int}
Expand Down

0 comments on commit 42801e7

Please sign in to comment.