Fixed issue where \LogLib2\Classes\Utilities::getSafeValue(mixed $input) would return a null value when the typed output is string
by including a branch that converts the gettype($input)
to a string when the input is null.
This commit is contained in:
parent
838b6137dc
commit
4848eee708
2 changed files with 11 additions and 1 deletions
|
@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.0.1] - 2025-01-22
|
||||||
|
|
||||||
|
Minor changes to the project
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed issue where \LogLib2\Classes\Utilities::getSafeValue(mixed $input) would return
|
||||||
|
a null value when the typed output is `string` by including a branch that converts
|
||||||
|
the `gettype($input)` to a string when the input is null.
|
||||||
|
|
||||||
|
|
||||||
## [1.0.0] - 2025-01-22
|
## [1.0.0] - 2025-01-22
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,8 @@
|
||||||
|
|
||||||
return match(strtolower(gettype($input)))
|
return match(strtolower(gettype($input)))
|
||||||
{
|
{
|
||||||
'boolean', 'integer', 'double', 'float', 'string', 'null' => $input,
|
'boolean', 'integer', 'double', 'float', 'string' => $input,
|
||||||
|
'null' => 'null',
|
||||||
default => sprintf('[%s]', strtoupper(gettype($input))),
|
default => sprintf('[%s]', strtoupper(gettype($input))),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue