From 82a8df20e18803ba84d7595cf9323995a365d441 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 31 Jul 2023 09:00:16 +0700 Subject: [PATCH] docs: PHPStan model no type specified --- phpstan-baseline.php | 25 ------------------------- system/BaseModel.php | 6 ++++++ system/Model.php | 4 ++++ 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index edf7e2771bfb..d3a50f311dcb 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -11,26 +11,11 @@ 'count' => 1, 'path' => __DIR__ . '/system/Autoloader/Autoloader.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:chunk\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/BaseModel.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:chunk\\(\\) has parameter \\$userFunc with no signature specified for Closure\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/BaseModel.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:doOnlyDeleted\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/BaseModel.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:initialize\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/BaseModel.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\Cache\\\\CacheInterface\\:\\:initialize\\(\\) has no return type specified\\.$#', 'count' => 1, @@ -1536,21 +1521,11 @@ 'count' => 1, 'path' => __DIR__ . '/system/Log/Handlers/ChromeLoggerHandler.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Model\\:\\:chunk\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Model.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\Model\\:\\:chunk\\(\\) has parameter \\$userFunc with no signature specified for Closure\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/Model.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Model\\:\\:doOnlyDeleted\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Model.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\Pager\\\\Exceptions\\\\PagerException\\:\\:forInvalidPaginationGroup\\(\\) has no return type specified\\.$#', 'count' => 1, diff --git a/system/BaseModel.php b/system/BaseModel.php index 0f316e6ffa3f..cd8b475196d5 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -338,6 +338,8 @@ public function __construct(?ValidationInterface $validation = null) /** * Initializes the instance with any additional steps. * Optionally implemented by child classes. + * + * @return void */ protected function initialize() { @@ -458,6 +460,8 @@ abstract protected function doPurgeDeleted(); * Works with the find* methods to return only the rows that * have been deleted. * This method works only with dbCalls. + * + * @return void */ abstract protected function doOnlyDeleted(); @@ -524,6 +528,8 @@ abstract public function countAllResults(bool $reset = true, bool $test = false) * @param int $size Size * @param Closure $userFunc Callback Function * + * @return void + * * @throws DataException */ abstract public function chunk(int $size, Closure $userFunc); diff --git a/system/Model.php b/system/Model.php index a9c8e4f2eba9..cc901f831de1 100644 --- a/system/Model.php +++ b/system/Model.php @@ -474,6 +474,8 @@ protected function doPurgeDeleted() * Works with the find* methods to return only the rows that * have been deleted. * This method works only with dbCalls. + * + * @return void */ protected function doOnlyDeleted() { @@ -554,6 +556,8 @@ public function getIdValue($data) * determine the rows to operate on. * This method works only with dbCalls. * + * @return void + * * @throws DataException */ public function chunk(int $size, Closure $userFunc)