mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 10:01:53 +00:00
Config: Try to coerce types, similar to YAML
This commit is contained in:
parent
4b00465e24
commit
90800a4124
@ -557,6 +557,13 @@ class Config{
|
|||||||
case "no":
|
case "no":
|
||||||
$v = false;
|
$v = false;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
$v = match($v){
|
||||||
|
(string) ((int) $v) => (int) $v,
|
||||||
|
(string) ((float) $v) => (float) $v,
|
||||||
|
default => $v,
|
||||||
|
};
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(isset($result[$k])){
|
if(isset($result[$k])){
|
||||||
\GlobalLogger::get()->debug("[Config] Repeated property " . $k . " on file " . $this->file);
|
\GlobalLogger::get()->debug("[Config] Repeated property " . $k . " on file " . $this->file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user