Skip to content

Commit fb102fb

Browse files
committed
docs: fix @return
1 parent 9d95248 commit fb102fb

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

system/BaseModel.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use CodeIgniter\Database\BaseResult;
1717
use CodeIgniter\Database\Exceptions\DatabaseException;
1818
use CodeIgniter\Database\Exceptions\DataException;
19+
use CodeIgniter\Database\Query;
1920
use CodeIgniter\Exceptions\ModelException;
2021
use CodeIgniter\I18n\Time;
2122
use CodeIgniter\Pager\Pager;
@@ -393,7 +394,7 @@ abstract protected function doUpdate($id = null, $data = null): bool;
393394
* @param int $batchSize The size of the batch to run
394395
* @param bool $returnSQL True means SQL is returned, false will execute the query
395396
*
396-
* @return mixed Number of rows affected or FALSE on failure
397+
* @return false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
397398
*
398399
* @throws DatabaseException
399400
*/
@@ -435,7 +436,7 @@ abstract protected function doOnlyDeleted();
435436
* @param array|null $data Data
436437
* @param bool $returnSQL Set to true to return Query String
437438
*
438-
* @return mixed
439+
* @return BaseResult|false|Query|string
439440
*/
440441
abstract protected function doReplace(?array $data = null, bool $returnSQL = false);
441442

@@ -480,7 +481,7 @@ public function getIdValue($data)
480481
* @param bool $reset Reset
481482
* @param bool $test Test
482483
*
483-
* @return mixed
484+
* @return int|string
484485
*/
485486
abstract public function countAllResults(bool $reset = true, bool $test = false);
486487

@@ -903,7 +904,7 @@ public function update($id = null, $data = null): bool
903904
* @param int $batchSize The size of the batch to run
904905
* @param bool $returnSQL True means SQL is returned, false will execute the query
905906
*
906-
* @return mixed Number of rows affected or FALSE on failure
907+
* @return false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
907908
*
908909
* @throws DatabaseException
909910
* @throws ReflectionException
@@ -997,7 +998,7 @@ public function delete($id = null, bool $purge = false)
997998
* Permanently deletes all rows that have been marked as deleted
998999
* through soft deletes (deleted = 1)
9991000
*
1000-
* @return mixed
1001+
* @return bool|string Returns a string if in test mode.
10011002
*/
10021003
public function purgeDeleted()
10031004
{
@@ -1043,7 +1044,7 @@ public function onlyDeleted()
10431044
* @param array|null $data Data
10441045
* @param bool $returnSQL Set to true to return Query String
10451046
*
1046-
* @return mixed
1047+
* @return BaseResult|false|Query|string
10471048
*/
10481049
public function replace(?array $data = null, bool $returnSQL = false)
10491050
{
@@ -1174,7 +1175,7 @@ protected function doProtectFields(array $data): array
11741175
*
11751176
* @param int|null $userData An optional PHP timestamp to be converted.
11761177
*
1177-
* @return mixed
1178+
* @return int|string
11781179
*
11791180
* @throws ModelException
11801181
*/
@@ -1461,7 +1462,7 @@ public function allowCallbacks(bool $val = true)
14611462
* @param string $event Event
14621463
* @param array $eventData Event Data
14631464
*
1464-
* @return mixed
1465+
* @return array
14651466
*
14661467
* @throws DataException
14671468
*/

system/Model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ protected function doUpdate($id = null, $data = null): bool
347347
* @param int $batchSize The size of the batch to run
348348
* @param bool $returnSQL True means SQL is returned, false will execute the query
349349
*
350-
* @return mixed Number of rows affected or FALSE on failure
350+
* @return false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
351351
*
352352
* @throws DatabaseException
353353
*/
@@ -432,7 +432,7 @@ protected function doOnlyDeleted()
432432
* @param array|null $data Data
433433
* @param bool $returnSQL Set to true to return Query String
434434
*
435-
* @return mixed
435+
* @return BaseResult|false|Query|string
436436
*/
437437
protected function doReplace(?array $data = null, bool $returnSQL = false)
438438
{
@@ -533,7 +533,7 @@ public function chunk(int $size, Closure $userFunc)
533533
/**
534534
* Override countAllResults to account for soft deleted accounts.
535535
*
536-
* @return mixed
536+
* @return int|string
537537
*/
538538
public function countAllResults(bool $reset = true, bool $test = false)
539539
{

0 commit comments

Comments
 (0)