| 1 |
CHANGELOG |
| 2 |
========= |
| 3 |
|
| 4 |
7.3 |
| 5 |
--- |
| 6 |
|
| 7 |
* Add compact nested mapping support by using the `Yaml::DUMP_COMPACT_NESTED_MAPPING` flag |
| 8 |
* Add the `Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES` flag to enforce double quotes around string values |
| 9 |
|
| 10 |
7.2 |
| 11 |
--- |
| 12 |
|
| 13 |
* Deprecate parsing duplicate mapping keys whose value is `null` |
| 14 |
* Add support for dumping `null` as an empty value by using the `Yaml::DUMP_NULL_AS_EMPTY` flag |
| 15 |
|
| 16 |
7.1 |
| 17 |
--- |
| 18 |
|
| 19 |
* Add support for getting all the enum cases with `!php/enum Foo` |
| 20 |
|
| 21 |
7.0 |
| 22 |
--- |
| 23 |
|
| 24 |
* Remove the `!php/const:` tag, use `!php/const` instead (without the colon) |
| 25 |
|
| 26 |
6.3 |
| 27 |
--- |
| 28 |
|
| 29 |
* Add support to dump int keys as strings by using the `Yaml::DUMP_NUMERIC_KEY_AS_STRING` flag |
| 30 |
|
| 31 |
6.2 |
| 32 |
--- |
| 33 |
|
| 34 |
* Add support for `!php/enum` and `!php/enum *->value` |
| 35 |
* Deprecate the `!php/const:` tag in key which will be replaced by the `!php/const` tag (without the colon) since 3.4 |
| 36 |
|
| 37 |
6.1 |
| 38 |
--- |
| 39 |
|
| 40 |
* In cases where it will likely improve readability, strings containing single quotes will be double-quoted |
| 41 |
|
| 42 |
5.4 |
| 43 |
--- |
| 44 |
|
| 45 |
* Add a `$maxNestingLevel` argument to `Parser::__construct()`, `Yaml::parse()` and `Yaml::parseFile()` to bound recursion depth (default 128) |
| 46 |
* Add a `$maxAliasesForCollections` argument to `Parser::__construct()`, `Yaml::parse()` and `Yaml::parseFile()` to bound alias expansion of collection values (default 128) |
| 47 |
* Add `Yaml::PARSE_EXCEPTION_ON_ALIAS` to reject YAML aliases while parsing untrusted input |
| 48 |
* Add new `lint:yaml dirname --exclude=/dirname/foo.yaml --exclude=/dirname/bar.yaml` |
| 49 |
option to exclude one or more specific files from multiple file list |
| 50 |
* Allow negatable for the parse tags option with `--no-parse-tags` |
| 51 |
|
| 52 |
5.3 |
| 53 |
--- |
| 54 |
|
| 55 |
* Added `github` format support & autodetection to render errors as annotations |
| 56 |
when running the YAML linter command in a Github Action environment. |
| 57 |
|
| 58 |
5.1.0 |
| 59 |
----- |
| 60 |
|
| 61 |
* Added support for parsing numbers prefixed with `0o` as octal numbers. |
| 62 |
* Deprecated support for parsing numbers starting with `0` as octal numbers. They will be parsed as strings as of Symfony 6.0. Prefix numbers with `0o` |
| 63 |
so that they are parsed as octal numbers. |
| 64 |
|
| 65 |
Before: |
| 66 |
|
| 67 |
```yaml |
| 68 |
Yaml::parse('072'); |
| 69 |
``` |
| 70 |
|
| 71 |
After: |
| 72 |
|
| 73 |
```yaml |
| 74 |
Yaml::parse('0o72'); |
| 75 |
``` |
| 76 |
|
| 77 |
* Added `yaml-lint` binary. |
| 78 |
* Deprecated using the `!php/object` and `!php/const` tags without a value. |
| 79 |
|
| 80 |
5.0.0 |
| 81 |
----- |
| 82 |
|
| 83 |
* Removed support for mappings inside multi-line strings. |
| 84 |
* removed support for implicit STDIN usage in the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. |
| 85 |
|
| 86 |
4.4.0 |
| 87 |
----- |
| 88 |
|
| 89 |
* Added support for parsing the inline notation spanning multiple lines. |
| 90 |
* Added support to dump `null` as `~` by using the `Yaml::DUMP_NULL_AS_TILDE` flag. |
| 91 |
* deprecated accepting STDIN implicitly when using the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. |
| 92 |
|
| 93 |
4.3.0 |
| 94 |
----- |
| 95 |
|
| 96 |
* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0. |
| 97 |
|
| 98 |
4.2.0 |
| 99 |
----- |
| 100 |
|
| 101 |
* added support for multiple files or directories in `LintCommand` |
| 102 |
|
| 103 |
4.0.0 |
| 104 |
----- |
| 105 |
|
| 106 |
* The behavior of the non-specific tag `!` is changed and now forces |
| 107 |
non-evaluating your values. |
| 108 |
* complex mappings will throw a `ParseException` |
| 109 |
* support for the comma as a group separator for floats has been dropped, use |
| 110 |
the underscore instead |
| 111 |
* support for the `!!php/object` tag has been dropped, use the `!php/object` |
| 112 |
tag instead |
| 113 |
* duplicate mapping keys throw a `ParseException` |
| 114 |
* non-string mapping keys throw a `ParseException`, use the `Yaml::PARSE_KEYS_AS_STRINGS` |
| 115 |
flag to cast them to strings |
| 116 |
* `%` at the beginning of an unquoted string throw a `ParseException` |
| 117 |
* mappings with a colon (`:`) that is not followed by a whitespace throw a |
| 118 |
`ParseException` |
| 119 |
* the `Dumper::setIndentation()` method has been removed |
| 120 |
* being able to pass boolean options to the `Yaml::parse()`, `Yaml::dump()`, |
| 121 |
`Parser::parse()`, and `Dumper::dump()` methods to configure the behavior of |
| 122 |
the parser and dumper is no longer supported, pass bitmask flags instead |
| 123 |
* the constructor arguments of the `Parser` class have been removed |
| 124 |
* the `Inline` class is internal and no longer part of the BC promise |
| 125 |
* removed support for the `!str` tag, use the `!!str` tag instead |
| 126 |
* added support for tagged scalars. |
| 127 |
|
| 128 |
```yml |
| 129 |
Yaml::parse('!foo bar', Yaml::PARSE_CUSTOM_TAGS); |
| 130 |
// returns TaggedValue('foo', 'bar'); |
| 131 |
``` |
| 132 |
|
| 133 |
3.4.0 |
| 134 |
----- |
| 135 |
|
| 136 |
* added support for parsing YAML files using the `Yaml::parseFile()` or `Parser::parseFile()` method |
| 137 |
|
| 138 |
* the `Dumper`, `Parser`, and `Yaml` classes are marked as final |
| 139 |
|
| 140 |
* Deprecated the `!php/object:` tag which will be replaced by the |
| 141 |
`!php/object` tag (without the colon) in 4.0. |
| 142 |
|
| 143 |
* Deprecated the `!php/const:` tag which will be replaced by the |
| 144 |
`!php/const` tag (without the colon) in 4.0. |
| 145 |
|
| 146 |
* Support for the `!str` tag is deprecated, use the `!!str` tag instead. |
| 147 |
|
| 148 |
* Deprecated using the non-specific tag `!` as its behavior will change in 4.0. |
| 149 |
It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead. |
| 150 |
|
| 151 |
3.3.0 |
| 152 |
----- |
| 153 |
|
| 154 |
* Starting an unquoted string with a question mark followed by a space is |
| 155 |
deprecated and will throw a `ParseException` in Symfony 4.0. |
| 156 |
|
| 157 |
* Deprecated support for implicitly parsing non-string mapping keys as strings. |
| 158 |
Mapping keys that are no strings will lead to a `ParseException` in Symfony |
| 159 |
4.0. Use quotes to opt-in for keys to be parsed as strings. |
| 160 |
|
| 161 |
Before: |
| 162 |
|
| 163 |
```php |
| 164 |
$yaml = <<<YAML |
| 165 |
null: null key |
| 166 |
true: boolean true |
| 167 |
2.0: float key |
| 168 |
YAML; |
| 169 |
|
| 170 |
Yaml::parse($yaml); |
| 171 |
``` |
| 172 |
|
| 173 |
After: |
| 174 |
|
| 175 |
```php |
| 176 |
|
| 177 |
$yaml = <<<YAML |
| 178 |
"null": null key |
| 179 |
"true": boolean true |
| 180 |
"2.0": float key |
| 181 |
YAML; |
| 182 |
|
| 183 |
Yaml::parse($yaml); |
| 184 |
``` |
| 185 |
|
| 186 |
* Omitted mapping values will be parsed as `null`. |
| 187 |
|
| 188 |
* Omitting the key of a mapping is deprecated and will throw a `ParseException` in Symfony 4.0. |
| 189 |
|
| 190 |
* Added support for dumping empty PHP arrays as YAML sequences: |
| 191 |
|
| 192 |
```php |
| 193 |
Yaml::dump([], 0, 0, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); |
| 194 |
``` |
| 195 |
|
| 196 |
3.2.0 |
| 197 |
----- |
| 198 |
|
| 199 |
* Mappings with a colon (`:`) that is not followed by a whitespace are deprecated |
| 200 |
when the mapping key is not quoted and will lead to a `ParseException` in |
| 201 |
Symfony 4.0 (e.g. `foo:bar` must be `foo: bar`). |
| 202 |
|
| 203 |
* Added support for parsing PHP constants: |
| 204 |
|
| 205 |
```php |
| 206 |
Yaml::parse('!php/const:PHP_INT_MAX', Yaml::PARSE_CONSTANT); |
| 207 |
``` |
| 208 |
|
| 209 |
* Support for silently ignoring duplicate mapping keys in YAML has been |
| 210 |
deprecated and will lead to a `ParseException` in Symfony 4.0. |
| 211 |
|
| 212 |
3.1.0 |
| 213 |
----- |
| 214 |
|
| 215 |
* Added support to dump `stdClass` and `ArrayAccess` objects as YAML mappings |
| 216 |
through the `Yaml::DUMP_OBJECT_AS_MAP` flag. |
| 217 |
|
| 218 |
* Strings that are not UTF-8 encoded will be dumped as base64 encoded binary |
| 219 |
data. |
| 220 |
|
| 221 |
* Added support for dumping multi line strings as literal blocks. |
| 222 |
|
| 223 |
* Added support for parsing base64 encoded binary data when they are tagged |
| 224 |
with the `!!binary` tag. |
| 225 |
|
| 226 |
* Added support for parsing timestamps as `\DateTime` objects: |
| 227 |
|
| 228 |
```php |
| 229 |
Yaml::parse('2001-12-15 21:59:43.10 -5', Yaml::PARSE_DATETIME); |
| 230 |
``` |
| 231 |
|
| 232 |
* `\DateTime` and `\DateTimeImmutable` objects are dumped as YAML timestamps. |
| 233 |
|
| 234 |
* Deprecated usage of `%` at the beginning of an unquoted string. |
| 235 |
|
| 236 |
* Added support for customizing the YAML parser behavior through an optional bit field: |
| 237 |
|
| 238 |
```php |
| 239 |
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE | Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP); |
| 240 |
``` |
| 241 |
|
| 242 |
* Added support for customizing the dumped YAML string through an optional bit field: |
| 243 |
|
| 244 |
```php |
| 245 |
Yaml::dump(['foo' => new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT); |
| 246 |
``` |
| 247 |
|
| 248 |
3.0.0 |
| 249 |
----- |
| 250 |
|
| 251 |
* Yaml::parse() now throws an exception when a blackslash is not escaped |
| 252 |
in double-quoted strings |
| 253 |
|
| 254 |
2.8.0 |
| 255 |
----- |
| 256 |
|
| 257 |
* Deprecated usage of a colon in an unquoted mapping value |
| 258 |
* Deprecated usage of @, \`, | and > at the beginning of an unquoted string |
| 259 |
* When surrounding strings with double-quotes, you must now escape `\` characters. Not |
| 260 |
escaping those characters (when surrounded by double-quotes) is deprecated. |
| 261 |
|
| 262 |
Before: |
| 263 |
|
| 264 |
```yml |
| 265 |
class: "Foo\Var" |
| 266 |
``` |
| 267 |
|
| 268 |
After: |
| 269 |
|
| 270 |
```yml |
| 271 |
class: "Foo\\Var" |
| 272 |
``` |
| 273 |
|
| 274 |
2.1.0 |
| 275 |
----- |
| 276 |
|
| 277 |
* Yaml::parse() does not evaluate loaded files as PHP files by default |
| 278 |
anymore (call Yaml::enablePhpParsing() to get back the old behavior) |