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 decoders. Chris@0: * Chris@0: * @author Jordi Boggiano Chris@0: */ Chris@0: interface DecoderInterface Chris@0: { Chris@0: /** Chris@0: * Decodes a string into PHP data. Chris@0: * Chris@0: * @param string $data Data to decode Chris@0: * @param string $format Format name Chris@14: * @param array $context Options that decoders have access to Chris@0: * Chris@0: * The format parameter specifies which format the data is in; valid values Chris@0: * depend on the specific implementation. Authors implementing this interface Chris@0: * are encouraged to document which formats they support in a non-inherited Chris@0: * phpdoc comment. Chris@0: * Chris@0: * @return mixed Chris@0: * Chris@0: * @throws UnexpectedValueException Chris@0: */ Chris@17: public function decode($data, $format, array $context = []); Chris@0: Chris@0: /** Chris@0: * Checks whether the deserializer can decode from given format. Chris@0: * Chris@14: * @param string $format Format name Chris@0: * Chris@0: * @return bool Chris@0: */ Chris@0: public function supportsDecoding($format); Chris@0: }