4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Serializer\Encoder;
14 use Symfony\Component\Serializer\Exception\UnexpectedValueException;
17 * Defines the interface of decoders.
19 * @author Jordi Boggiano <j.boggiano@seld.be>
21 interface DecoderInterface
24 * Decodes a string into PHP data.
26 * @param string $data Data to decode
27 * @param string $format Format name
28 * @param array $context Options that decoders have access to
30 * The format parameter specifies which format the data is in; valid values
31 * depend on the specific implementation. Authors implementing this interface
32 * are encouraged to document which formats they support in a non-inherited
37 * @throws UnexpectedValueException
39 public function decode($data, $format, array $context = array());
42 * Checks whether the deserializer can decode from given format.
44 * @param string $format Format name
48 public function supportsDecoding($format);