mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Config: use JSON_THROW_ON_ERROR for encoding
This commit is contained in:
parent
1a046c6cd5
commit
8e8cee45b8
@ -53,6 +53,7 @@ use function yaml_parse;
|
|||||||
use const CASE_LOWER;
|
use const CASE_LOWER;
|
||||||
use const JSON_BIGINT_AS_STRING;
|
use const JSON_BIGINT_AS_STRING;
|
||||||
use const JSON_PRETTY_PRINT;
|
use const JSON_PRETTY_PRINT;
|
||||||
|
use const JSON_THROW_ON_ERROR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config Class for simple config manipulation of multiple formats.
|
* Config Class for simple config manipulation of multiple formats.
|
||||||
@ -212,7 +213,7 @@ class Config{
|
|||||||
$content = self::writeProperties($this->config);
|
$content = self::writeProperties($this->config);
|
||||||
break;
|
break;
|
||||||
case Config::JSON:
|
case Config::JSON:
|
||||||
$content = json_encode($this->config, $this->jsonOptions);
|
$content = json_encode($this->config, $this->jsonOptions | JSON_THROW_ON_ERROR);
|
||||||
break;
|
break;
|
||||||
case Config::YAML:
|
case Config::YAML:
|
||||||
$content = yaml_emit($this->config, YAML_UTF8_ENCODING);
|
$content = yaml_emit($this->config, YAML_UTF8_ENCODING);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user