84
84
* @method $this where($key, $value = null, ?bool $escape = null)
85
85
* @method $this whereIn(?string $key = null, $values = null, ?bool $escape = null)
86
86
* @method $this whereNotIn(?string $key = null, $values = null, ?bool $escape = null)
87
+ *
88
+ * @phpstan-import-type RowArray from \CodeIgniter\BaseModel
87
89
*/
88
90
class Model extends BaseModel
89
91
{
@@ -178,6 +180,7 @@ public function setTable(string $table)
178
180
* @param array|int|string|null $id One primary key or an array of primary keys
179
181
*
180
182
* @return array|object|null The resulting row of data, or null.
183
+ * @phpstan-return ($singleton is true ? RowArray|null|object : list<RowArray|object>)
181
184
*/
182
185
protected function doFind (bool $ singleton , $ id = null )
183
186
{
@@ -224,6 +227,7 @@ protected function doFindColumn(string $columnName)
224
227
* @param int $offset Offset
225
228
*
226
229
* @return array
230
+ * @phpstan-return list<RowArray|object>
227
231
*/
228
232
protected function doFindAll (int $ limit = 0 , int $ offset = 0 )
229
233
{
@@ -244,6 +248,7 @@ protected function doFindAll(int $limit = 0, int $offset = 0)
244
248
* This method works only with dbCalls.
245
249
*
246
250
* @return array|object|null
251
+ * @phpstan-return RowArray|object|null
247
252
*/
248
253
protected function doFirst ()
249
254
{
@@ -411,7 +416,7 @@ protected function doUpdateBatch(?array $set = null, ?string $index = null, int
411
416
* @param array|int|string|null $id The rows primary key(s)
412
417
* @param bool $purge Allows overriding the soft deletes setting.
413
418
*
414
- * @return bool|string
419
+ * @return bool|string SQL string when testMode
415
420
*
416
421
* @throws DatabaseException
417
422
*/
@@ -450,7 +455,7 @@ protected function doDelete($id = null, bool $purge = false)
450
455
* through soft deletes (deleted = 1)
451
456
* This method works only with dbCalls.
452
457
*
453
- * @return bool|string Returns a string if in test mode.
458
+ * @return bool|string Returns a SQL string if in test mode.
454
459
*/
455
460
protected function doPurgeDeleted ()
456
461
{
@@ -491,7 +496,7 @@ protected function doReplace(?array $data = null, bool $returnSQL = false)
491
496
* ['source' => 'message']
492
497
* This method works only with dbCalls.
493
498
*
494
- * @return array<string,string>
499
+ * @return array<string, string>
495
500
*/
496
501
protected function doErrors ()
497
502
{
0 commit comments