From f92f091694dfa27280c4bf8c9532bada90bc7b0b Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Sat, 24 Jun 2023 21:54:17 +0900 Subject: [PATCH 1/2] docs: Replace type `mixed` in system. --- system/BaseModel.php | 2 +- system/CodeIgniter.php | 2 +- system/Common.php | 8 ++++---- system/Model.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/system/BaseModel.php b/system/BaseModel.php index 26b6952291e4..8d5b4276eb43 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -1711,7 +1711,7 @@ protected function transformDataToArray($data, string $type): array * * @param string $name Name * - * @return mixed + * @return array|bool|int|object|string|null */ public function __get(string $name) { diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 829b65ea952b..5285a9293ae1 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -732,7 +732,7 @@ public static function cache(int $time) * Caches the full response from the current request. Used for * full-page caching for very high performance. * - * @return mixed + * @return bool */ public function cachePage(Cache $config) { diff --git a/system/Common.php b/system/Common.php index 8d366973f14d..bdc937af2aa7 100644 --- a/system/Common.php +++ b/system/Common.php @@ -65,8 +65,8 @@ function app_timezone(): string * cache()->save('foo', 'bar'); * $foo = cache('bar'); * - * @return CacheInterface|mixed - * @phpstan-return ($key is null ? CacheInterface : mixed) + * @return array|bool|CacheInterface|float|int|object|string|null + * @phpstan-return ($key is null ? CacheInterface : array|bool|float|int|object|string|null) */ function cache(?string $key = null) { @@ -1003,7 +1003,7 @@ function session(?string $val = null) * - $timer = service('timer') * - $timer = \CodeIgniter\Config\Services::timer(); * - * @param mixed ...$params + * @param array|bool|float|int|object|string|null ...$params * * @return object */ @@ -1017,7 +1017,7 @@ function service(string $name, ...$params) /** * Always returns a new instance of the class. * - * @param mixed ...$params + * @param array|bool|float|int|object|string|null ...$params * * @return object|null */ diff --git a/system/Model.php b/system/Model.php index 80e4bb48a34c..c28bf2b9da1c 100644 --- a/system/Model.php +++ b/system/Model.php @@ -792,7 +792,7 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur * * @param string $name Name * - * @return mixed + * @return array|BaseBuilder|bool|int|object|string|null */ public function __get(string $name) { @@ -821,7 +821,7 @@ public function __isset(string $name): bool * Provides direct access to method in the builder (if available) * and the database connection. * - * @return mixed + * @return array|BaseBuilder|bool|float|int|object|string|null */ public function __call(string $name, array $params) { From 70f566f5224af1b5ef35844f44ef91b22e8b1c4a Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Thu, 29 Jun 2023 18:24:08 +0800 Subject: [PATCH 2/2] docs: Add the type. --- system/BaseModel.php | 2 +- system/Model.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/BaseModel.php b/system/BaseModel.php index 8d5b4276eb43..06b8190f037f 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -1711,7 +1711,7 @@ protected function transformDataToArray($data, string $type): array * * @param string $name Name * - * @return array|bool|int|object|string|null + * @return array|bool|float|int|object|string|null */ public function __get(string $name) { diff --git a/system/Model.php b/system/Model.php index c28bf2b9da1c..b60bb966dd85 100644 --- a/system/Model.php +++ b/system/Model.php @@ -792,7 +792,7 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur * * @param string $name Name * - * @return array|BaseBuilder|bool|int|object|string|null + * @return array|BaseBuilder|bool|float|int|object|string|null */ public function __get(string $name) { @@ -821,7 +821,7 @@ public function __isset(string $name): bool * Provides direct access to method in the builder (if available) * and the database connection. * - * @return array|BaseBuilder|bool|float|int|object|string|null + * @return $this|array|BaseBuilder|bool|float|int|object|string|null */ public function __call(string $name, array $params) {