Skip to content

Commit add8ad8

Browse files
authored
Merge pull request #7755 from ddevsr/model-type-specified
docs: PHPStan `Model` no type specified
2 parents 87454e6 + 82a8df2 commit add8ad8

File tree

3 files changed

+10
-25
lines changed

3 files changed

+10
-25
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,11 @@
1111
'count' => 1,
1212
'path' => __DIR__ . '/system/Autoloader/Autoloader.php',
1313
];
14-
$ignoreErrors[] = [
15-
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:chunk\\(\\) has no return type specified\\.$#',
16-
'count' => 1,
17-
'path' => __DIR__ . '/system/BaseModel.php',
18-
];
1914
$ignoreErrors[] = [
2015
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:chunk\\(\\) has parameter \\$userFunc with no signature specified for Closure\\.$#',
2116
'count' => 1,
2217
'path' => __DIR__ . '/system/BaseModel.php',
2318
];
24-
$ignoreErrors[] = [
25-
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:doOnlyDeleted\\(\\) has no return type specified\\.$#',
26-
'count' => 1,
27-
'path' => __DIR__ . '/system/BaseModel.php',
28-
];
29-
$ignoreErrors[] = [
30-
'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:initialize\\(\\) has no return type specified\\.$#',
31-
'count' => 1,
32-
'path' => __DIR__ . '/system/BaseModel.php',
33-
];
3419
$ignoreErrors[] = [
3520
'message' => '#^Method CodeIgniter\\\\Cache\\\\CacheInterface\\:\\:initialize\\(\\) has no return type specified\\.$#',
3621
'count' => 1,
@@ -1536,21 +1521,11 @@
15361521
'count' => 1,
15371522
'path' => __DIR__ . '/system/Log/Handlers/ChromeLoggerHandler.php',
15381523
];
1539-
$ignoreErrors[] = [
1540-
'message' => '#^Method CodeIgniter\\\\Model\\:\\:chunk\\(\\) has no return type specified\\.$#',
1541-
'count' => 1,
1542-
'path' => __DIR__ . '/system/Model.php',
1543-
];
15441524
$ignoreErrors[] = [
15451525
'message' => '#^Method CodeIgniter\\\\Model\\:\\:chunk\\(\\) has parameter \\$userFunc with no signature specified for Closure\\.$#',
15461526
'count' => 1,
15471527
'path' => __DIR__ . '/system/Model.php',
15481528
];
1549-
$ignoreErrors[] = [
1550-
'message' => '#^Method CodeIgniter\\\\Model\\:\\:doOnlyDeleted\\(\\) has no return type specified\\.$#',
1551-
'count' => 1,
1552-
'path' => __DIR__ . '/system/Model.php',
1553-
];
15541529
$ignoreErrors[] = [
15551530
'message' => '#^Method CodeIgniter\\\\Pager\\\\Exceptions\\\\PagerException\\:\\:forInvalidPaginationGroup\\(\\) has no return type specified\\.$#',
15561531
'count' => 1,

system/BaseModel.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ public function __construct(?ValidationInterface $validation = null)
338338
/**
339339
* Initializes the instance with any additional steps.
340340
* Optionally implemented by child classes.
341+
*
342+
* @return void
341343
*/
342344
protected function initialize()
343345
{
@@ -458,6 +460,8 @@ abstract protected function doPurgeDeleted();
458460
* Works with the find* methods to return only the rows that
459461
* have been deleted.
460462
* This method works only with dbCalls.
463+
*
464+
* @return void
461465
*/
462466
abstract protected function doOnlyDeleted();
463467

@@ -524,6 +528,8 @@ abstract public function countAllResults(bool $reset = true, bool $test = false)
524528
* @param int $size Size
525529
* @param Closure $userFunc Callback Function
526530
*
531+
* @return void
532+
*
527533
* @throws DataException
528534
*/
529535
abstract public function chunk(int $size, Closure $userFunc);

system/Model.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ protected function doPurgeDeleted()
474474
* Works with the find* methods to return only the rows that
475475
* have been deleted.
476476
* This method works only with dbCalls.
477+
*
478+
* @return void
477479
*/
478480
protected function doOnlyDeleted()
479481
{
@@ -554,6 +556,8 @@ public function getIdValue($data)
554556
* determine the rows to operate on.
555557
* This method works only with dbCalls.
556558
*
559+
* @return void
560+
*
557561
* @throws DataException
558562
*/
559563
public function chunk(int $size, Closure $userFunc)

0 commit comments

Comments
 (0)