Config: Try to coerce types, similar to YAML

This commit is contained in:
Dylan K. Taylor 2021-10-06 21:07:57 +01:00
parent 4b00465e24
commit 90800a4124
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -557,6 +557,13 @@ class Config{
case "no":
$v = false;
break;
default:
$v = match($v){
(string) ((int) $v) => (int) $v,
(string) ((float) $v) => (float) $v,
default => $v,
};
break;
}
if(isset($result[$k])){
\GlobalLogger::get()->debug("[Config] Repeated property " . $k . " on file " . $this->file);