<?php

namespace Symfony\Component\Serializer\Encoder;

use Symfony\Component\Serializer\Exception\UnexpectedValueException;

interface DecoderInterface
{
    /**
     * @param string $data
     * @param string $format
     * @param array<mixed> $context
     * @return mixed
     *
     * @throws UnexpectedValueException
     */
    public function decode($data, $format, array $context = []);

    /**
     * @param string $format Format name
     * @param array<mixed> $context
     * @return bool
     */
    public function supportsDecoding($format, array $context = []);
}
