1CHANGELOG
2=========
3
45.0.0
5-----
6
7 * Removed support for mappings inside multi-line strings.
8 * removed support for implicit STDIN usage in the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit.
9
104.4.0
11-----
12
13 * Added support for parsing the inline notation spanning multiple lines.
14 * Added support to dump `null` as `~` by using the `Yaml::DUMP_NULL_AS_TILDE` flag.
15 * deprecated accepting STDIN implicitly when using the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit.
16
174.3.0
18-----
19
20 * Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.
21
224.2.0
23-----
24
25 * added support for multiple files or directories in `LintCommand`
26
274.0.0
28-----
29
30 * The behavior of the non-specific tag `!` is changed and now forces
31 non-evaluating your values.
32 * complex mappings will throw a `ParseException`
33 * support for the comma as a group separator for floats has been dropped, use
34 the underscore instead
35 * support for the `!!php/object` tag has been dropped, use the `!php/object`
36 tag instead
37 * duplicate mapping keys throw a `ParseException`
38 * non-string mapping keys throw a `ParseException`, use the `Yaml::PARSE_KEYS_AS_STRINGS`
39 flag to cast them to strings
40 * `%` at the beginning of an unquoted string throw a `ParseException`
41 * mappings with a colon (`:`) that is not followed by a whitespace throw a
42 `ParseException`
43 * the `Dumper::setIndentation()` method has been removed
44 * being able to pass boolean options to the `Yaml::parse()`, `Yaml::dump()`,
45 `Parser::parse()`, and `Dumper::dump()` methods to configure the behavior of
46 the parser and dumper is no longer supported, pass bitmask flags instead
47 * the constructor arguments of the `Parser` class have been removed
48 * the `Inline` class is internal and no longer part of the BC promise
49 * removed support for the `!str` tag, use the `!!str` tag instead
50 * added support for tagged scalars.
51
52 ```yml
53 Yaml::parse('!foo bar', Yaml::PARSE_CUSTOM_TAGS);
54 // returns TaggedValue('foo', 'bar');
55 ```
56
573.4.0
58-----
59
60 * added support for parsing YAML files using the `Yaml::parseFile()` or `Parser::parseFile()` method
61
62 * the `Dumper`, `Parser`, and `Yaml` classes are marked as final
63
64 * Deprecated the `!php/object:` tag which will be replaced by the
65 `!php/object` tag (without the colon) in 4.0.
66
67 * Deprecated the `!php/const:` tag which will be replaced by the
68 `!php/const` tag (without the colon) in 4.0.
69
70 * Support for the `!str` tag is deprecated, use the `!!str` tag instead.
71
72 * Deprecated using the non-specific tag `!` as its behavior will change in 4.0.
73 It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead.
74
753.3.0
76-----
77
78 * Starting an unquoted string with a question mark followed by a space is
79 deprecated and will throw a `ParseException` in Symfony 4.0.
80
81 * Deprecated support for implicitly parsing non-string mapping keys as strings.
82 Mapping keys that are no strings will lead to a `ParseException` in Symfony
83 4.0. Use quotes to opt-in for keys to be parsed as strings.
84
85 Before:
86
87 ```php
88 $yaml = <<<YAML
89 null: null key
90 true: boolean true
91 2.0: float key
92 YAML;
93
94 Yaml::parse($yaml);
95 ```
96
97 After:
98
99 ```php
100
101 $yaml = <<<YAML
102 "null": null key
103 "true": boolean true
104 "2.0": float key
105 YAML;
106
107 Yaml::parse($yaml);
108 ```
109
110 * Omitted mapping values will be parsed as `null`.
111
112 * Omitting the key of a mapping is deprecated and will throw a `ParseException` in Symfony 4.0.
113
114 * Added support for dumping empty PHP arrays as YAML sequences:
115
116 ```php
117 Yaml::dump([], 0, 0, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE);
118 ```
119
1203.2.0
121-----
122
123 * Mappings with a colon (`:`) that is not followed by a whitespace are deprecated
124 when the mapping key is not quoted and will lead to a `ParseException` in
125 Symfony 4.0 (e.g. `foo:bar` must be `foo: bar`).
126
127 * Added support for parsing PHP constants:
128
129 ```php
130 Yaml::parse('!php/const:PHP_INT_MAX', Yaml::PARSE_CONSTANT);
131 ```
132
133 * Support for silently ignoring duplicate mapping keys in YAML has been
134 deprecated and will lead to a `ParseException` in Symfony 4.0.
135
1363.1.0
137-----
138
139 * Added support to dump `stdClass` and `ArrayAccess` objects as YAML mappings
140 through the `Yaml::DUMP_OBJECT_AS_MAP` flag.
141
142 * Strings that are not UTF-8 encoded will be dumped as base64 encoded binary
143 data.
144
145 * Added support for dumping multi line strings as literal blocks.
146
147 * Added support for parsing base64 encoded binary data when they are tagged
148 with the `!!binary` tag.
149
150 * Added support for parsing timestamps as `\DateTime` objects:
151
152 ```php
153 Yaml::parse('2001-12-15 21:59:43.10 -5', Yaml::PARSE_DATETIME);
154 ```
155
156 * `\DateTime` and `\DateTimeImmutable` objects are dumped as YAML timestamps.
157
158 * Deprecated usage of `%` at the beginning of an unquoted string.
159
160 * Added support for customizing the YAML parser behavior through an optional bit field:
161
162 ```php
163 Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE | Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP);
164 ```
165
166 * Added support for customizing the dumped YAML string through an optional bit field:
167
168 ```php
169 Yaml::dump(['foo' => new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT);
170 ```
171
1723.0.0
173-----
174
175 * Yaml::parse() now throws an exception when a blackslash is not escaped
176 in double-quoted strings
177
1782.8.0
179-----
180
181 * Deprecated usage of a colon in an unquoted mapping value
182 * Deprecated usage of @, \`, | and > at the beginning of an unquoted string
183 * When surrounding strings with double-quotes, you must now escape `\` characters. Not
184 escaping those characters (when surrounded by double-quotes) is deprecated.
185
186 Before:
187
188 ```yml
189 class: "Foo\Var"
190 ```
191
192 After:
193
194 ```yml
195 class: "Foo\\Var"
196 ```
197
1982.1.0
199-----
200
201 * Yaml::parse() does not evaluate loaded files as PHP files by default
202 anymore (call Yaml::enablePhpParsing() to get back the old behavior)
203