<?php

namespace Symfony\Component\Serializer\Encoder;

use Symfony\Component\Serializer\Exception\UnexpectedValueException;

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

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