Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Serializer\Encoder; Chris@0: Chris@0: use Symfony\Component\Serializer\Exception\UnexpectedValueException; Chris@0: Chris@0: /** Chris@0: * Defines the interface of encoders. Chris@0: * Chris@0: * @author Jordi Boggiano Chris@0: */ Chris@0: interface EncoderInterface Chris@0: { Chris@0: /** Chris@0: * Encodes data into the given format. Chris@0: * Chris@0: * @param mixed $data Data to encode Chris@0: * @param string $format Format name Chris@14: * @param array $context Options that normalizers/encoders have access to Chris@0: * Chris@14: * @return string|int|float|bool Chris@0: * Chris@0: * @throws UnexpectedValueException Chris@0: */ Chris@17: public function encode($data, $format, array $context = []); Chris@0: Chris@0: /** Chris@0: * Checks whether the serializer can encode to given format. Chris@0: * Chris@14: * @param string $format Format name Chris@0: * Chris@0: * @return bool Chris@0: */ Chris@0: public function supportsEncoding($format); Chris@0: }