You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
if ('' !==$key &&$evaluatedKey !==$key && !is_string($evaluatedKey) && !is_int($evaluatedKey)) {
496
-
@trigger_error('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Use quotes instead.',E_USER_DEPRECATED);
496
+
@trigger_error('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Quote your evaluable mapping keys instead.',E_USER_DEPRECATED);
Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Parser.php
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,10 @@ public function parse($value, $flags = 0)
86
86
}
87
87
}
88
88
89
+
if (Yaml::PARSE_KEYS_AS_STRINGS &$flags) {
90
+
@trigger_error('Using the Yaml::PARSE_KEYS_AS_STRINGS flag is deprecated since version 3.4 as it will be removed in 4.0. Quote your keys when they are evaluable instead.',E_USER_DEPRECATED);
91
+
}
92
+
89
93
if (false ===preg_match('//u',$value)) {
90
94
thrownewParseException('The YAML value does not appear to be valid UTF-8.');
91
95
}
@@ -220,7 +224,15 @@ private function doParse($value, $flags)
@@ -229,7 +241,7 @@ private function doParse($value, $flags)
229
241
}
230
242
231
243
if (!is_string($key) && !is_int($key)) {
232
-
@trigger_error('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.',E_USER_DEPRECATED);
244
+
@trigger_error('Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Quote your evaluable mapping keys instead.',E_USER_DEPRECATED);
233
245
}
234
246
235
247
// Convert float keys to strings, to avoid being converted to integers by PHP
Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/InlineTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -730,7 +730,7 @@ public function testTheEmptyStringIsAValidMappingKey()
730
730
731
731
/**
732
732
* @group legacy
733
-
* @expectedDeprecation Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Use quotes instead.
733
+
* @expectedDeprecation Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Quote your evaluable mapping keys instead.
Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/ParserTest.php
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1064,7 +1064,7 @@ public function testYamlDirective()
1064
1064
1065
1065
/**
1066
1066
* @group legacy
1067
-
* @expectedDeprecation Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.
1067
+
* @expectedDeprecation Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Quote your evaluable mapping keys instead.
1068
1068
*/
1069
1069
publicfunctiontestFloatKeys()
1070
1070
{
@@ -1086,7 +1086,7 @@ public function testFloatKeys()
1086
1086
1087
1087
/**
1088
1088
* @group legacy
1089
-
* @expectedDeprecation Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Pass the PARSE_KEYS_AS_STRING flag to explicitly enable the type casts.
1089
+
* @expectedDeprecation Implicit casting of incompatible mapping keys to strings is deprecated since version 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.Quote your evaluable mapping keys instead.
1090
1090
*/
1091
1091
publicfunctiontestBooleanKeys()
1092
1092
{
@@ -1817,6 +1817,15 @@ public function testPhpConstantTagMappingKey()
* @expectedDeprecation Using the Yaml::PARSE_KEYS_AS_STRINGS flag is deprecated since version 3.4 as it will be removed in 4.0. Quote your keys when they are evaluable instead.