return $value->value;
} if (self::
$exceptionOnInvalidType) { throw new ParseException(sprintf('The string "%s" could not be parsed as an enum. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?',
$scalar), self::
$parsedLineNumber + 1,
$scalar, self::
$parsedFilename);
} return null;
case str_starts_with($scalar, '!!float '
):
return (float) substr($scalar, 8
);
case str_starts_with($scalar, '!!binary '
):
return self::
evaluateBinaryScalar(substr($scalar, 9
));
} throw new ParseException(sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.',
$scalar), self::
$parsedLineNumber,
$scalar, self::
$parsedFilename);
case preg_match('/^(?:\+|-)?0o(?P<value>[0-7_]++)$/',
$scalar,
$matches):
$value =
str_replace('_', '',
$matches['value'
]);
if ('-' ===
$scalar[0
]) { return -
octdec($value);
} return octdec($value);