mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-02 07:28:13 -05:00
fix: correct konw issues
This commit is contained in:
parent
da635d0b3b
commit
8a75523796
@ -142,7 +142,7 @@ class Server extends Model
|
|||||||
private function castValueWithConfig($value, array $config)
|
private function castValueWithConfig($value, array $config)
|
||||||
{
|
{
|
||||||
if ($value === null) {
|
if ($value === null) {
|
||||||
return $config['default'];
|
return $config['default'] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return match ($config['type']) {
|
return match ($config['type']) {
|
||||||
@ -152,7 +152,7 @@ class Server extends Model
|
|||||||
'array' => (array) $value,
|
'array' => (array) $value,
|
||||||
'object' => is_array($value) ?
|
'object' => is_array($value) ?
|
||||||
$this->castSettingsWithConfig($value, $config['fields']) :
|
$this->castSettingsWithConfig($value, $config['fields']) :
|
||||||
$config['default'],
|
$config['default'] ?? null,
|
||||||
default => $value
|
default => $value
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user