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
Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Dumper.php
-30Lines changed: 0 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -37,18 +37,6 @@ public function __construct($indentation = 4)
37
37
$this->indentation = $indentation;
38
38
}
39
39
40
-
/**
41
-
* Sets the indentation.
42
-
*
43
-
* @param int $num The amount of spaces to use for indentation of nested nodes
44
-
*/
45
-
publicfunctionsetIndentation($num)
46
-
{
47
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 3.1 and will be removed in 4.0. Pass the indentation to the constructor instead.', E_USER_DEPRECATED);
48
-
49
-
$this->indentation = (int) $num;
50
-
}
51
-
52
40
/**
53
41
* Dumps a PHP value to YAML.
54
42
*
@@ -61,24 +49,6 @@ public function setIndentation($num)
@trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED);
66
-
67
-
if ($flags) {
68
-
$flags = Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE;
69
-
} else {
70
-
$flags = 0;
71
-
}
72
-
}
73
-
74
-
if (func_num_args() >= 5) {
75
-
@trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.', E_USER_DEPRECATED);
@trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED);
51
-
52
-
if ($flags) {
53
-
$flags = Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE;
54
-
} else {
55
-
$flags = 0;
56
-
}
57
-
}
58
-
59
-
if (func_num_args() >= 3 && !is_array($references)) {
60
-
@trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT flag instead.', E_USER_DEPRECATED);
61
-
62
-
if ($references) {
63
-
$flags |= Yaml::PARSE_OBJECT;
64
-
}
65
-
66
-
if (func_num_args() >= 4) {
67
-
@trigger_error('Passing a boolean flag to toggle object for map support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.', E_USER_DEPRECATED);
@@ -137,24 +105,6 @@ public static function parse($value, $flags = 0, $references = array())
137
105
*/
138
106
publicstaticfunctiondump($value, $flags = 0)
139
107
{
140
-
if (is_bool($flags)) {
141
-
@trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED);
142
-
143
-
if ($flags) {
144
-
$flags = Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE;
145
-
} else {
146
-
$flags = 0;
147
-
}
148
-
}
149
-
150
-
if (func_num_args() >= 3) {
151
-
@trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.', E_USER_DEPRECATED);
152
-
153
-
if (func_get_arg(2)) {
154
-
$flags |= Yaml::DUMP_OBJECT;
155
-
}
156
-
}
157
-
158
108
switch (true) {
159
109
caseis_resource($value):
160
110
if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
@@ -300,7 +250,7 @@ private static function dumpArray($value, $flags)
thrownewParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]));
335
285
}
336
286
337
-
if ($output && '%' === $output[0]) {
338
-
@trigger_error(sprintf('Not quoting the scalar "%s" starting with the "%%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.', $output), E_USER_DEPRECATED);
@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);
443
+
thrownewParseException('Non-string mapping keys are not supported. Pass the Yaml::PARSE_KEYS_AS_STRINGS flag to cast them to strings.', self::$parsedLineNumber + 1, $mapping);
@trigger_error('Using a colon that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}" is deprecated since version 3.2 and will throw a ParseException in 4.0.', E_USER_DEPRECATED);
thrownewParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping);
502
449
}
503
450
504
451
while ($i < $len) {
@@ -509,7 +456,6 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
509
456
}
510
457
511
458
$tag = self::parseTag($mapping, $i, $flags);
512
-
$duplicate = false;
513
459
switch ($mapping[$i]) {
514
460
case'[':
515
461
// nested sequence
@@ -518,8 +464,7 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
518
464
// Parser cannot abort this mapping earlier, since lines
519
465
// are processed sequentially.
520
466
if (isset($output[$key])) {
521
-
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
@@ -529,8 +474,7 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
529
474
// Parser cannot abort this mapping earlier, since lines
530
475
// are processed sequentially.
531
476
if (isset($output[$key])) {
532
-
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
@@ -539,19 +483,17 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
539
483
// Parser cannot abort this mapping earlier, since lines
540
484
// are processed sequentially.
541
485
if (isset($output[$key])) {
542
-
@trigger_error(sprintf('Duplicate key "%s" detected on line %d whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since version 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.', $key, self::$parsedLineNumber + 1), E_USER_DEPRECATED);
thrownewParseException('Object support when parsing a YAML file has been disabled.');
621
563
}
622
564
623
-
return;
624
-
case0 === strpos($scalar, '!!php/object:'):
625
-
if (self::$objectSupport) {
626
-
@trigger_error('The !!php/object tag to indicate dumped PHP objects is deprecated since version 3.1 and will be removed in 4.0. Use the !php/object tag instead.', E_USER_DEPRECATED);
627
-
628
-
returnunserialize(substr($scalar, 13));
629
-
}
630
-
631
-
if (self::$exceptionOnInvalidType) {
632
-
thrownewParseException('Object support when parsing a YAML file has been disabled.');
0 commit comments