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]));
330
+
if ($indicator = $reader->eatAny(array('@', '`', '|', '>'))) {
331
+
thrownewParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $indicator));
322
332
}
323
333
324
-
if ($output && '%' === $output[0]) {
334
+
if ($reader->eat('%')) {
325
335
@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);
326
336
}
327
337
@@ -333,36 +343,6 @@ public static function parseScalar($scalar, $flags = 0, $delimiters = null, $str
333
343
return$output;
334
344
}
335
345
336
-
/**
337
-
* Parses a quoted scalar to YAML.
338
-
*
339
-
* @param string $scalar
340
-
* @param int &$i
341
-
*
342
-
* @return string A YAML string
343
-
*
344
-
* @throws ParseException When malformed inline YAML string is parsed
@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.');
554
+
}
555
+
556
+
return;
557
+
} elseif ($reader->eat('php/const:')) {
558
+
if (self::$constantSupport) {
559
+
$constant = $reader->readToFullConsumption();
560
+
if (defined($constant)) {
561
+
returnconstant($constant);
562
+
}
563
+
564
+
thrownewParseException(sprintf('The constant "%s" is not defined.', $constant));
565
+
}
566
+
if (self::$exceptionOnInvalidType) {
567
+
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.');
584
-
}
585
-
586
-
return;
587
-
case0 === strpos($scalar, '!!php/object:'):
588
-
if (self::$objectSupport) {
589
-
@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);
590
-
591
-
returnunserialize(substr($scalar, 13));
592
-
}
593
-
594
-
if (self::$exceptionOnInvalidType) {
595
-
thrownewParseException('Object support when parsing a YAML file has been disabled.');
596
-
}
597
-
598
-
return;
599
-
case0 === strpos($scalar, '!php/const:'):
600
-
if (self::$constantSupport) {
601
-
if (defined($const = substr($scalar, 11))) {
602
-
returnconstant($const);
603
-
}
604
-
605
-
thrownewParseException(sprintf('The constant "%s" is not defined.', $const));
606
-
}
607
-
if (self::$exceptionOnInvalidType) {
608
-
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));
609
-
}
610
-
611
-
return;
612
-
case0 === strpos($scalar, '!!float '):
613
-
return (float) substr($scalar, 8);
614
593
casepreg_match('{^[+-]?[0-9][0-9_]*$}', $scalar):
615
594
$scalar = str_replace('_', '', (string) $scalar);
616
595
// omitting the break / return as integers are handled in the next case
0 commit comments