public static function createForUnparsableValue(string $value, int $code = 0, \Throwable $previous) : UnexpectedValueException { return new UnexpectedValueException(sprintf('Could not parse value "%s".', $value), $code, $previous); }
/** * @param ParserInterface $parser * @param string $value * * @return mixed|ValueInterface */ private function parseValue(ParserInterface $parser, string $value) { try { return $parser->parse($value); } catch (ParseThrowable $throwable) { throw DenormalizerExceptionFactory::createForUnparsableValue($value, 0, $throwable); } }