* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Serializer\Encoder; /** * Encodes JSON data. * * @author Jordi Boggiano */ class JsonEncoder implements EncoderInterface, DecoderInterface { const FORMAT = 'json'; protected $encodingImpl; protected $decodingImpl; public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodingImpl = null) { $this->encodingImpl = $encodingImpl ?: new JsonEncode(); $this->decodingImpl = $decodingImpl ?: new JsonDecode(true); } /** * {@inheritdoc} */ public function encode($data, $format, array $context = array()) { return $this->encodingImpl->encode($data, self::FORMAT, $context); } /** * {@inheritdoc} */ public function decode($data, $format, array $context = array()) { return $this->decodingImpl->decode($data, self::FORMAT, $context); } /** * {@inheritdoc} */ public function supportsEncoding($format) { return self::FORMAT === $format; } /** * {@inheritdoc} */ public function supportsDecoding($format) { return self::FORMAT === $format; } } __halt_compiler();----SIGNATURE:----FqUnni83RtK2zv+Ulgw8FlLPFT5SEt8Nn4d2wcgG91jF78UfVYkETKDOjK/VmruhlkP0loYUifQjSBKO7x4iTVdtJxYnQaa6K9u7nPvRY/TyuI9Ctwd6XSKebK0MmRej+Rp4t+DjlUD0E7fQSBSTHuEfjFAAuCi9pecCPHE/4Aq4NF4HGrvfUumpAyIvDbRAJMVMYBuGELJzb3Z283dxChdxjbSb8BB8bwteUgQ37zPhh6FHKVgH/h86ZlOPssXo3wqope2BlODFvok8RT1WFNO9vml7boXnYiRy9nnCTfuCkX9ZKWSMt5ucNOCQtNppQ2AKINgPeKqX09Cn43yjnvsGFtmd8DNO3z8Hb2sdlx1jCtehbnurTwm2uzqfWExvxYrL6tqTYbDx1YuLsEwvAQzP5NV6ru4UKEzydZBQwGyrZ9AXHPSxqLeLHMr7JN9kc31BqdYQxhYBjfw2L15Qp009VbdHdD1d54Y3pCfH2TvVo16CPUMFDuRlu/5+vor/N0F3WEZG6HiawazTIEllFDFoNZeLtefVKH6ep3bC556J+yh36VIqkHVq0trbVy12Ah0ahOzM5EK/pUfidcPeIa78kxbqgwLBkE7POYqvlIpC0BRUCa0jKE4PjRyHk0vDnkX/7NJOHsKARgs9Y4YLhNtt4qRCOrfrtTctVHVG1Cs=----ATTACHMENT:----OTMyNDQzMDE5NzUzNDQ2MCA2NTk4NjIxNTQ2NjM5NjUwIDY3MjQ5Njk0OTI5MTcx