Skip to content

Commit 1f7c4d6

Browse files
committed
apply review feedback
1 parent 4530331 commit 1f7c4d6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

core/Config/SectionConfig.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public static function setConfigValue(string $name, $value): void
3434
/**
3535
* Get a setting value
3636
*
37+
* Prefer one of the type-safe getters if a specific type is expected:
38+
* @see getIntegerConfigValue()
39+
* @see getFloatConfigValue()
40+
* @see getBoolConfigValue()
41+
* @see getStringConfigValue()
42+
* @see getArrayConfigValue()
43+
*
3744
* @param string $name Setting name
3845
* @param int|null $idSite Optional site Id
3946
*
@@ -151,6 +158,10 @@ private static function castIntConfigValue(string $name, $value, ?int $default):
151158
*/
152159
private static function castFloatConfigValue(string $name, $value, ?float $default): ?float
153160
{
161+
if ($value === null) {
162+
return $default;
163+
}
164+
154165
$parsedFloat = Common::parseFloat($value);
155166
if ($parsedFloat !== null) {
156167
return $parsedFloat;

0 commit comments

Comments
 (0)