* * 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:----g/YQkB5tf/U5r7llKdlMOe/cXlOVMc89jLGuF3bxdnaSfY65CEiLoVIPcOj67DgXcutpEN0FyCK9LAPht4l1Zxo3ZhCpnoSrVGRZZH5ddJF8MebkV1tg2KZNKTCxyW9WweTvoJitvCdOMG3JaujDh/mnQipH/HdffSveZULQlEt2WpkRid02G8tmj3fwsxG8Ed02gP7oHwif0YAXhlt3AWF96W0SVO2POTooACiM4nnzzOsJlpvkAFJtI4aXOeBgaCg5Rh0lg1RYAKl6Qx4ggx8LjGmb6iMUdBg2rlyKJCYRX09PVMLLp7grr83Z/YoPGkvaQENXyLle/CKdw0IKUzKOM+Nx1Xwr3073JxY3oXmSJqJKAZMIQq22HhVeJq3TDJK8uzhdCxNBcuq3KDRla69ZyS5nkUDfL0PmNt5W+W9EDGmsNgXfl8TtX3z2aoxzI6s6P/7RlGgHIDaLz0K76HXlqoQIbNZAsh1QiYfO/w6dCXCOJZeVV73rDOmLK0IwOgAqVlF5AgbROt2gEURcVJlECwhBdsrrIIdQ1yAXPTlQT+qA/K6tNFklxmdpg33iQrTfbydadOKw6GwyVlw1QjMtdYnF0gYmj+q288+U4iNb/wrXSyMvSLko8aOHyOzICKJ1uznRGyE8Rf8c41IErxPtwbFPFzB7yVrqLYTUDGI=----ATTACHMENT:----OTYwMDMxODE1MzQ5OTUxNyA1ODU4OTExNTc3ODI0NjUwIDY3MjgzMzUyNjUxMTczMTE=