Skip to content

Commit 207c664

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
2 parents 32f42e9 + 4eed29c commit 207c664

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,11 +2581,6 @@
25812581
'count' => 1,
25822582
'path' => __DIR__ . '/system/Model.php',
25832583
];
2584-
$ignoreErrors[] = [
2585-
'message' => '#^Return type \\(int\\|object\\|string\\|false\\) of method CodeIgniter\\\\Model\\:\\:insert\\(\\) should be covariant with return type \\(bool\\|int\\|string\\) of method CodeIgniter\\\\BaseModel\\:\\:insert\\(\\)$#',
2586-
'count' => 1,
2587-
'path' => __DIR__ . '/system/Model.php',
2588-
];
25892584
$ignoreErrors[] = [
25902585
'message' => '#^Accessing offset mixed directly on \\$_GET is discouraged\\.$#',
25912586
'count' => 1,

system/BaseModel.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,12 @@ public function getInsertID()
720720
* Inserts data into the database. If an object is provided,
721721
* it will attempt to convert it to an array.
722722
*
723-
* @param array|object|null $data Data
724-
* @param bool $returnID Whether insert ID should be returned or not.
723+
* @param array|object|null $data Data
724+
* @phpstan-param row_array|object|null $data
725+
* @param bool $returnID Whether insert ID should be returned or not.
725726
*
726727
* @return bool|int|string insert ID or true on success. false on failure.
728+
* @phpstan-return ($returnID is true ? int|string|false : bool)
727729
*
728730
* @throws ReflectionException
729731
*/

system/Model.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,11 @@ protected function shouldUpdate($data): bool
680680
* it will attempt to convert it to an array.
681681
*
682682
* @param array|object|null $data
683-
* @param bool $returnID Whether insert ID should be returned or not.
683+
* @phpstan-param row_array|object|null $data
684+
* @param bool $returnID Whether insert ID should be returned or not.
684685
*
685-
* @return BaseResult|false|int|object|string
686+
* @return false|int|object|string
687+
* @phpstan-return ($returnID is true ? int|string|false : bool)
686688
*
687689
* @throws ReflectionException
688690
*/

0 commit comments

Comments
 (0)