Skip to content

Commit

Permalink
docs: add comment manually
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Sep 24, 2023
1 parent 2276c6a commit 4ee7742
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion system/Cache/Handlers/PredisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down
6 changes: 5 additions & 1 deletion system/Cache/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down
1 change: 1 addition & 0 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ function env(string $key, $default = null)
return $default;
}

// Handle any boolean values
return match (strtolower($value)) {
'true' => true,
'false' => false,
Expand Down

0 comments on commit 4ee7742

Please sign in to comment.