From 4ee77426211f0051e532994005846bc00c070edf Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Sep 2023 06:17:16 +0900 Subject: [PATCH] docs: add comment manually --- system/Cache/Handlers/PredisHandler.php | 6 +++++- system/Cache/Handlers/RedisHandler.php | 6 +++++- system/Common.php | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/system/Cache/Handlers/PredisHandler.php b/system/Cache/Handlers/PredisHandler.php index 0dab42a25635..a597989c39ce 100644 --- a/system/Cache/Handlers/PredisHandler.php +++ b/system/Cache/Handlers/PredisHandler.php @@ -88,7 +88,11 @@ public function get(string $key) return match ($data['__ci_type']) { 'array', 'object' => unserialize($data['__ci_value']), - 'boolean', 'integer', 'double', 'string', 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, + 'boolean', + 'integer', + 'double', // Yes, 'double' is returned and NOT 'float' + 'string', + 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, default => null, }; } diff --git a/system/Cache/Handlers/RedisHandler.php b/system/Cache/Handlers/RedisHandler.php index 24b40bf98da0..0050e1d6fe6c 100644 --- a/system/Cache/Handlers/RedisHandler.php +++ b/system/Cache/Handlers/RedisHandler.php @@ -114,7 +114,11 @@ public function get(string $key) return match ($data['__ci_type']) { 'array', 'object' => unserialize($data['__ci_value']), - 'boolean', 'integer', 'double', 'string', 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, + 'boolean', + 'integer', + 'double', // Yes, 'double' is returned and NOT 'float' + 'string', + 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, default => null, }; } diff --git a/system/Common.php b/system/Common.php index e7644c080a13..e5577ea017b9 100644 --- a/system/Common.php +++ b/system/Common.php @@ -373,6 +373,7 @@ function env(string $key, $default = null) return $default; } + // Handle any boolean values return match (strtolower($value)) { 'true' => true, 'false' => false,