1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-11 23:54:06 +02:00

Flextype Core: YamlParser - improve encode method flags

Default flags:
 Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK
 Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE
This commit is contained in:
Awilum
2019-02-13 18:31:29 +03:00
parent 63cc3351ba
commit 8b77295494

View File

@@ -52,7 +52,7 @@ class YamlParser {
*
* @var int
*/
public static $flag = 16;
public static $flag = Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK|Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE;
/**
* Dumps a PHP value to a YAML string.
@@ -67,7 +67,7 @@ class YamlParser {
*
* @return string A YAML string representing the original PHP value
*/
public static function encode($input, int $inline = 5, int $indent = 2, int $flags = 16) : string
public static function encode($input, int $inline = 5, int $indent = 2, int $flags = Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK|Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE) : string
{
try {
return Yaml::dump(