@trigger_error('Passing a boolean flag to toggle exception handling is deprecated since Symfony 3.1 and will be removed in 4.0. Use the Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE flag instead.',E_USER_DEPRECATED);
if($flags){
$flags=Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE;
}else{
$flags=0;
}
}
if(\func_num_args()>=3&&!\is_array($references)){
@trigger_error('Passing a boolean flag to toggle object support is deprecated since Symfony 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT flag instead.',E_USER_DEPRECATED);
if($references){
$flags|=Yaml::PARSE_OBJECT;
}
if(\func_num_args()>=4){
@trigger_error('Passing a boolean flag to toggle object for map support is deprecated since Symfony 3.1 and will be removed in 4.0. Use the Yaml::PARSE_OBJECT_FOR_MAP flag instead.',E_USER_DEPRECATED);
@trigger_error('Passing a boolean flag to toggle exception handling is deprecated since Symfony 3.1 and will be removed in 4.0. Use the Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.',E_USER_DEPRECATED);
if($flags){
$flags=Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE;
}else{
$flags=0;
}
}
if(\func_num_args()>=3){
@trigger_error('Passing a boolean flag to toggle object support is deprecated since Symfony 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.',E_USER_DEPRECATED);
if(func_get_arg(2)){
$flags|=Yaml::DUMP_OBJECT;
}
}
switch(true){
case\is_resource($value):
if(Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE&$flags){
thrownewDumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").',get_resource_type($value)));
thrownewParseException(sprintf('Unexpected end of line, expected one of "%s".',implode('',$delimiters)),self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
thrownewParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.',$output[0]),self::$parsedLineNumber+1,$output,self::$parsedFilename);
}
if($output&&'%'===$output[0]){
@trigger_error(self::getDeprecationMessage(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(self::getDeprecationMessage('Implicit casting of incompatible mapping keys to strings is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead.'),E_USER_DEPRECATED);
@trigger_error(self::getDeprecationMessage('Using a colon after an unquoted mapping key that is not followed by an indication character (i.e. " ", ",", "[", "]", "{", "}") is deprecated since Symfony 3.2 and will throw a ParseException in 4.0.'),E_USER_DEPRECATED);
// Parser cannot abort this mapping earlier, since lines
// are processed sequentially.
// But overwriting is allowed when a merge node is used in current block.
if('<<'===$key){
foreach($valueas$parsedValue){
$output+=$parsedValue;
}
}elseif($allowOverwrite||!isset($output[$key])){
if(null!==$tag){
$output[$key]=newTaggedValue($tag,$value);
}else{
$output[$key]=$value;
}
}elseif(isset($output[$key])){
@trigger_error(self::getDeprecationMessage(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.',$key)),E_USER_DEPRECATED);
// Parser cannot abort this mapping earlier, since lines
// are processed sequentially.
// But overwriting is allowed when a merge node is used in current block.
if('<<'===$key){
$output+=$value;
}elseif($allowOverwrite||!isset($output[$key])){
if(null!==$tag){
$output[$key]=newTaggedValue($tag,$value);
}else{
$output[$key]=$value;
}
}elseif(isset($output[$key])){
@trigger_error(self::getDeprecationMessage(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.',$key)),E_USER_DEPRECATED);
// Parser cannot abort this mapping earlier, since lines
// are processed sequentially.
// But overwriting is allowed when a merge node is used in current block.
if('<<'===$key){
$output+=$value;
}elseif($allowOverwrite||!isset($output[$key])){
if(null!==$tag){
$output[$key]=newTaggedValue($tag,$value);
}else{
$output[$key]=$value;
}
}elseif(isset($output[$key])){
@trigger_error(self::getDeprecationMessage(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0.',$key)),E_USER_DEPRECATED);
thrownewParseException('A reference must contain at least one character.',self::$parsedLineNumber+1,$value,self::$parsedFilename);
}
if(!array_key_exists($value,$references)){
thrownewParseException(sprintf('Reference "%s" does not exist.',$value),self::$parsedLineNumber+1,$value,self::$parsedFilename);
}
return$references[$value];
}
switch(true){
case'null'===$scalarLower:
case''===$scalar:
case'~'===$scalar:
return;
case'true'===$scalarLower:
returntrue;
case'false'===$scalarLower:
returnfalse;
case'!'===$scalar[0]:
switch(true){
case0===strpos($scalar,'!str'):
@trigger_error(self::getDeprecationMessage('Support for the !str tag is deprecated since Symfony 3.4. Use the !!str tag instead.'),E_USER_DEPRECATED);
return(string)substr($scalar,5);
case0===strpos($scalar,'!!str '):
return(string)substr($scalar,6);
case0===strpos($scalar,'! '):
@trigger_error(self::getDeprecationMessage('Using the non-specific tag "!" is deprecated since Symfony 3.4 as its behavior will change in 4.0. It will force non-evaluating your values in 4.0. Use plain integers or !!float instead.'),E_USER_DEPRECATED);
@trigger_error(self::getDeprecationMessage('The !php/object: tag to indicate dumped PHP objects is deprecated since Symfony 3.4 and will be removed in 4.0. Use the !php/object (without the colon) tag instead.'),E_USER_DEPRECATED);
returnunserialize(substr($scalar,12));
}
if(self::$exceptionOnInvalidType){
thrownewParseException('Object support when parsing a YAML file has been disabled.',self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
}
return;
case0===strpos($scalar,'!!php/object:'):
if(self::$objectSupport){
@trigger_error(self::getDeprecationMessage('The !!php/object: tag to indicate dumped PHP objects is deprecated since Symfony 3.1 and will be removed in 4.0. Use the !php/object (without the colon) tag instead.'),E_USER_DEPRECATED);
returnunserialize(substr($scalar,13));
}
if(self::$exceptionOnInvalidType){
thrownewParseException('Object support when parsing a YAML file has been disabled.',self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
thrownewParseException('Object support when parsing a YAML file has been disabled.',self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
}
return;
case0===strpos($scalar,'!php/const:'):
if(self::$constantSupport){
@trigger_error(self::getDeprecationMessage('The !php/const: tag to indicate dumped PHP constants is deprecated since Symfony 3.4 and will be removed in 4.0. Use the !php/const (without the colon) tag instead.'),E_USER_DEPRECATED);
if(\defined($const=substr($scalar,11))){
return\constant($const);
}
thrownewParseException(sprintf('The constant "%s" is not defined.',$const),self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
}
if(self::$exceptionOnInvalidType){
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),self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
thrownewParseException(sprintf('The constant "%s" is not defined.',$const),self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
}
if(self::$exceptionOnInvalidType){
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),self::$parsedLineNumber+1,$scalar,self::$parsedFilename);
@trigger_error(self::getDeprecationMessage(sprintf('Using the unquoted scalar value "%s" is deprecated since Symfony 3.3 and will be considered as a tagged value in 4.0. You must quote it.',$scalar)),E_USER_DEPRECATED);
@trigger_error(self::getDeprecationMessage('Using the comma as a group separator for floats is deprecated since Symfony 3.2 and will be removed in 4.0.'),E_USER_DEPRECATED);
// Manage non-whitelisted scalars in {@link self::evaluateScalar()}
return;
}
// Built-in tags
if($tag&&'!'===$tag[0]){
thrownewParseException(sprintf('The built-in tag "!%s" is not implemented.',$tag),self::$parsedLineNumber+1,$value,self::$parsedFilename);
}
if(Yaml::PARSE_CUSTOM_TAGS&$flags){
$i=$nextOffset;
return$tag;
}
thrownewParseException(sprintf('Tags support is not enabled. Enable the `Yaml::PARSE_CUSTOM_TAGS` flag to use "!%s".',$tag),self::$parsedLineNumber+1,$value,self::$parsedFilename);
thrownewParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).',\strlen($parsedBinaryData)),self::$parsedLineNumber+1,$scalar,self::$parsedFilename);