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 Oct 12, 2023
1 parent d563cad commit c0e394b
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 c0e394b

Please sign in to comment.