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
thrownewParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]));
319
+
if ($indicator = $reader->eatAny(array('@', '`', '|', '>'))) {
320
+
thrownewParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $indicator));
320
321
}
321
322
322
-
if ($output && '%' === $output[0]) {
323
-
@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);
323
+
if ($reader->eat('%')) {
324
+
@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);
324
325
}
325
326
326
327
if ($evaluate) {
@@ -535,17 +536,12 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
@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);
thrownewParseException('Object support when parsing a YAML file has been disabled.');
573
+
}
574
+
575
+
return;
576
+
} elseif ($reader->eat('php/const:')) {
577
+
if (self::$constantSupport) {
578
+
$constant = $reader->readToFullConsumption();
579
+
if (defined($constant)) {
580
+
returnconstant($constant);
581
+
}
582
+
583
+
thrownewParseException(sprintf('The constant "%s" is not defined.', $constant));
584
+
}
585
+
if (self::$exceptionOnInvalidType) {
586
+
thrownewParseException(sprintf('The string "%s" could not be parsed as a constant. Have you forgotten to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar));
thrownewParseException('Object support when parsing a YAML file has been disabled.');
582
-
}
583
-
584
-
return;
585
-
case0 === strpos($scalar, '!!php/object:'):
586
-
if (self::$objectSupport) {
587
-
@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);
588
-
589
-
returnunserialize(substr($scalar, 13));
590
-
}
591
-
592
-
if (self::$exceptionOnInvalidType) {
593
-
thrownewParseException('Object support when parsing a YAML file has been disabled.');
594
-
}
595
-
596
-
return;
597
-
case0 === strpos($scalar, '!php/const:'):
598
-
if (self::$constantSupport) {
599
-
if (defined($const = substr($scalar, 11))) {
600
-
returnconstant($const);
601
-
}
602
-
603
-
thrownewParseException(sprintf('The constant "%s" is not defined.', $const));
604
-
}
605
-
if (self::$exceptionOnInvalidType) {
606
-
thrownewParseException(sprintf('The string "%s" could not be parsed as a constant. Have you forgotten to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar));
607
-
}
608
-
609
-
return;
610
-
case0 === strpos($scalar, '!!float '):
611
-
return (float) substr($scalar, 8);
612
612
casepreg_match('{^[+-]?[0-9][0-9_]*$}', $scalar):
613
613
$scalar = str_replace('_', '', (string) $scalar);
614
614
// omitting the break / return as integers are handled in the next case
0 commit comments