Chris@0
|
1 CHANGELOG
|
Chris@0
|
2 =========
|
Chris@0
|
3
|
Chris@14
|
4 3.4.0
|
Chris@14
|
5 -----
|
Chris@14
|
6
|
Chris@14
|
7 * added support for parsing YAML files using the `Yaml::parseFile()` or `Parser::parseFile()` method
|
Chris@14
|
8
|
Chris@14
|
9 * the `Dumper`, `Parser`, and `Yaml` classes are marked as final
|
Chris@14
|
10
|
Chris@14
|
11 * Deprecated the `!php/object:` tag which will be replaced by the
|
Chris@14
|
12 `!php/object` tag (without the colon) in 4.0.
|
Chris@14
|
13
|
Chris@14
|
14 * Deprecated the `!php/const:` tag which will be replaced by the
|
Chris@14
|
15 `!php/const` tag (without the colon) in 4.0.
|
Chris@14
|
16
|
Chris@14
|
17 * Support for the `!str` tag is deprecated, use the `!!str` tag instead.
|
Chris@14
|
18
|
Chris@14
|
19 * Deprecated using the non-specific tag `!` as its behavior will change in 4.0.
|
Chris@14
|
20 It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead.
|
Chris@14
|
21
|
Chris@14
|
22 3.3.0
|
Chris@14
|
23 -----
|
Chris@14
|
24
|
Chris@14
|
25 * Starting an unquoted string with a question mark followed by a space is
|
Chris@14
|
26 deprecated and will throw a `ParseException` in Symfony 4.0.
|
Chris@14
|
27
|
Chris@14
|
28 * Deprecated support for implicitly parsing non-string mapping keys as strings.
|
Chris@14
|
29 Mapping keys that are no strings will lead to a `ParseException` in Symfony
|
Chris@14
|
30 4.0. Use quotes to opt-in for keys to be parsed as strings.
|
Chris@14
|
31
|
Chris@14
|
32 Before:
|
Chris@14
|
33
|
Chris@14
|
34 ```php
|
Chris@14
|
35 $yaml = <<<YAML
|
Chris@14
|
36 null: null key
|
Chris@14
|
37 true: boolean true
|
Chris@14
|
38 2.0: float key
|
Chris@14
|
39 YAML;
|
Chris@14
|
40
|
Chris@14
|
41 Yaml::parse($yaml);
|
Chris@14
|
42 ```
|
Chris@14
|
43
|
Chris@14
|
44 After:
|
Chris@14
|
45
|
Chris@14
|
46 ```php
|
Chris@14
|
47
|
Chris@14
|
48 $yaml = <<<YAML
|
Chris@14
|
49 "null": null key
|
Chris@14
|
50 "true": boolean true
|
Chris@14
|
51 "2.0": float key
|
Chris@14
|
52 YAML;
|
Chris@14
|
53
|
Chris@14
|
54 Yaml::parse($yaml);
|
Chris@14
|
55 ```
|
Chris@14
|
56
|
Chris@14
|
57 * Omitted mapping values will be parsed as `null`.
|
Chris@14
|
58
|
Chris@14
|
59 * Omitting the key of a mapping is deprecated and will throw a `ParseException` in Symfony 4.0.
|
Chris@14
|
60
|
Chris@14
|
61 * Added support for dumping empty PHP arrays as YAML sequences:
|
Chris@14
|
62
|
Chris@14
|
63 ```php
|
Chris@14
|
64 Yaml::dump([], 0, 0, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE);
|
Chris@14
|
65 ```
|
Chris@14
|
66
|
Chris@0
|
67 3.2.0
|
Chris@0
|
68 -----
|
Chris@0
|
69
|
Chris@0
|
70 * Mappings with a colon (`:`) that is not followed by a whitespace are deprecated
|
Chris@12
|
71 when the mapping key is not quoted and will lead to a `ParseException` in
|
Chris@12
|
72 Symfony 4.0 (e.g. `foo:bar` must be `foo: bar`).
|
Chris@0
|
73
|
Chris@0
|
74 * Added support for parsing PHP constants:
|
Chris@0
|
75
|
Chris@0
|
76 ```php
|
Chris@0
|
77 Yaml::parse('!php/const:PHP_INT_MAX', Yaml::PARSE_CONSTANT);
|
Chris@0
|
78 ```
|
Chris@0
|
79
|
Chris@0
|
80 * Support for silently ignoring duplicate mapping keys in YAML has been
|
Chris@0
|
81 deprecated and will lead to a `ParseException` in Symfony 4.0.
|
Chris@0
|
82
|
Chris@0
|
83 3.1.0
|
Chris@0
|
84 -----
|
Chris@0
|
85
|
Chris@0
|
86 * Added support to dump `stdClass` and `ArrayAccess` objects as YAML mappings
|
Chris@0
|
87 through the `Yaml::DUMP_OBJECT_AS_MAP` flag.
|
Chris@0
|
88
|
Chris@0
|
89 * Strings that are not UTF-8 encoded will be dumped as base64 encoded binary
|
Chris@0
|
90 data.
|
Chris@0
|
91
|
Chris@0
|
92 * Added support for dumping multi line strings as literal blocks.
|
Chris@0
|
93
|
Chris@0
|
94 * Added support for parsing base64 encoded binary data when they are tagged
|
Chris@0
|
95 with the `!!binary` tag.
|
Chris@0
|
96
|
Chris@0
|
97 * Added support for parsing timestamps as `\DateTime` objects:
|
Chris@0
|
98
|
Chris@0
|
99 ```php
|
Chris@0
|
100 Yaml::parse('2001-12-15 21:59:43.10 -5', Yaml::PARSE_DATETIME);
|
Chris@0
|
101 ```
|
Chris@0
|
102
|
Chris@0
|
103 * `\DateTime` and `\DateTimeImmutable` objects are dumped as YAML timestamps.
|
Chris@0
|
104
|
Chris@0
|
105 * Deprecated usage of `%` at the beginning of an unquoted string.
|
Chris@0
|
106
|
Chris@0
|
107 * Added support for customizing the YAML parser behavior through an optional bit field:
|
Chris@0
|
108
|
Chris@0
|
109 ```php
|
Chris@0
|
110 Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE | Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP);
|
Chris@0
|
111 ```
|
Chris@0
|
112
|
Chris@0
|
113 * Added support for customizing the dumped YAML string through an optional bit field:
|
Chris@0
|
114
|
Chris@0
|
115 ```php
|
Chris@17
|
116 Yaml::dump(['foo' => new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT);
|
Chris@0
|
117 ```
|
Chris@0
|
118
|
Chris@0
|
119 3.0.0
|
Chris@0
|
120 -----
|
Chris@0
|
121
|
Chris@0
|
122 * Yaml::parse() now throws an exception when a blackslash is not escaped
|
Chris@0
|
123 in double-quoted strings
|
Chris@0
|
124
|
Chris@0
|
125 2.8.0
|
Chris@0
|
126 -----
|
Chris@0
|
127
|
Chris@0
|
128 * Deprecated usage of a colon in an unquoted mapping value
|
Chris@0
|
129 * Deprecated usage of @, \`, | and > at the beginning of an unquoted string
|
Chris@0
|
130 * When surrounding strings with double-quotes, you must now escape `\` characters. Not
|
Chris@0
|
131 escaping those characters (when surrounded by double-quotes) is deprecated.
|
Chris@0
|
132
|
Chris@0
|
133 Before:
|
Chris@0
|
134
|
Chris@0
|
135 ```yml
|
Chris@0
|
136 class: "Foo\Var"
|
Chris@0
|
137 ```
|
Chris@0
|
138
|
Chris@0
|
139 After:
|
Chris@0
|
140
|
Chris@0
|
141 ```yml
|
Chris@0
|
142 class: "Foo\\Var"
|
Chris@0
|
143 ```
|
Chris@0
|
144
|
Chris@0
|
145 2.1.0
|
Chris@0
|
146 -----
|
Chris@0
|
147
|
Chris@0
|
148 * Yaml::parse() does not evaluate loaded files as PHP files by default
|
Chris@0
|
149 anymore (call Yaml::enablePhpParsing() to get back the old behavior)
|