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]));
328
+
if ($indicator = $reader->eatAny(array('@', '`', '|', '>'))) {
329
+
thrownewParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $indicator));
320
330
}
321
331
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);
332
+
if ($reader->eat('%')) {
333
+
@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
334
}
325
335
326
336
if ($evaluate) {
@@ -343,20 +353,15 @@ public static function parseScalar($scalar, $flags = 0, $delimiters = null, $str
@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.');
577
+
}
578
+
579
+
return;
580
+
} elseif ($reader->eat('php/const:')) {
581
+
if (self::$constantSupport) {
582
+
$constant = $reader->readToFullConsumption();
583
+
if (defined($constant)) {
584
+
returnconstant($constant);
585
+
}
586
+
587
+
thrownewParseException(sprintf('The constant "%s" is not defined.', $constant));
588
+
}
589
+
if (self::$exceptionOnInvalidType) {
590
+
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
616
casepreg_match('{^[+-]?[0-9][0-9_]*$}', $scalar):
613
617
$scalar = str_replace('_', '', (string) $scalar);
614
618
// omitting the break / return as integers are handled in the next case
0 commit comments