Projekt

Obecné

Profil

Stáhnout (3.26 KB) Statistiky
| Větev: | Revize:
1
CHANGELOG
2
=========
3

    
4
3.3.0
5
-----
6

    
7
 * Starting an unquoted string with a question mark followed by a space is
8
   deprecated and will throw a `ParseException` in Symfony 4.0.
9

    
10
 * Deprecated support for implicitly parsing non-string mapping keys as strings.
11
   Mapping keys that are no strings will lead to a `ParseException` in Symfony
12
   4.0. Use quotes to opt-in for keys to be parsed as strings.
13

    
14
   Before:
15

    
16
   ```php
17
   $yaml = <<<YAML
18
   null: null key
19
   true: boolean true
20
   2.0: float key
21
   YAML;
22

    
23
   Yaml::parse($yaml);
24
   ```
25

    
26
   After:
27

    
28
   ```php
29

    
30
   $yaml = <<<YAML
31
   "null": null key
32
   "true": boolean true
33
   "2.0": float key
34
   YAML;
35

    
36
   Yaml::parse($yaml);
37
   ```
38

    
39
 * Omitted mapping values will be parsed as `null`.
40

    
41
 * Omitting the key of a mapping is deprecated and will throw a `ParseException` in Symfony 4.0.
42

    
43
 * Added support for dumping empty PHP arrays as YAML sequences:
44

    
45
   ```php
46
   Yaml::dump([], 0, 0, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE);
47
   ```
48

    
49
3.2.0
50
-----
51

    
52
 * Mappings with a colon (`:`) that is not followed by a whitespace are deprecated
53
   when the mapping key is not quoted and will lead to a `ParseException` in
54
   Symfony 4.0 (e.g. `foo:bar` must be `foo: bar`).
55

    
56
 * Added support for parsing PHP constants:
57

    
58
   ```php
59
   Yaml::parse('!php/const:PHP_INT_MAX', Yaml::PARSE_CONSTANT);
60
   ```
61

    
62
 * Support for silently ignoring duplicate mapping keys in YAML has been
63
   deprecated and will lead to a `ParseException` in Symfony 4.0.
64

    
65
3.1.0
66
-----
67

    
68
 * Added support to dump `stdClass` and `ArrayAccess` objects as YAML mappings
69
   through the `Yaml::DUMP_OBJECT_AS_MAP` flag.
70

    
71
 * Strings that are not UTF-8 encoded will be dumped as base64 encoded binary
72
   data.
73

    
74
 * Added support for dumping multi line strings as literal blocks.
75

    
76
 * Added support for parsing base64 encoded binary data when they are tagged
77
   with the `!!binary` tag.
78

    
79
 * Added support for parsing timestamps as `\DateTime` objects:
80

    
81
   ```php
82
   Yaml::parse('2001-12-15 21:59:43.10 -5', Yaml::PARSE_DATETIME);
83
   ```
84

    
85
 * `\DateTime` and `\DateTimeImmutable` objects are dumped as YAML timestamps.
86

    
87
 * Deprecated usage of `%` at the beginning of an unquoted string.
88

    
89
 * Added support for customizing the YAML parser behavior through an optional bit field:
90

    
91
   ```php
92
   Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE | Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP);
93
   ```
94

    
95
 * Added support for customizing the dumped YAML string through an optional bit field:
96

    
97
   ```php
98
   Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT);
99
   ```
100

    
101
3.0.0
102
-----
103

    
104
 * Yaml::parse() now throws an exception when a blackslash is not escaped
105
   in double-quoted strings
106

    
107
2.8.0
108
-----
109

    
110
 * Deprecated usage of a colon in an unquoted mapping value
111
 * Deprecated usage of @, \`, | and > at the beginning of an unquoted string
112
 * When surrounding strings with double-quotes, you must now escape `\` characters. Not
113
   escaping those characters (when surrounded by double-quotes) is deprecated.
114

    
115
   Before:
116

    
117
   ```yml
118
   class: "Foo\Var"
119
   ```
120

    
121
   After:
122

    
123
   ```yml
124
   class: "Foo\\Var"
125
   ```
126

    
127
2.1.0
128
-----
129

    
130
 * Yaml::parse() does not evaluate loaded files as PHP files by default
131
   anymore (call Yaml::enablePhpParsing() to get back the old behavior)
(2-2/12)