* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Serializer\Normalizer; use Symfony\Component\Serializer\SerializerAwareInterface; use Symfony\Component\Serializer\SerializerAwareTrait; /** * @author Jordi Boggiano */ class CustomNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface { use ObjectToPopulateTrait; use SerializerAwareTrait; private $cache = array(); /** * {@inheritdoc} */ public function normalize($object, $format = null, array $context = array()) { return $object->normalize($this->serializer, $format, $context); } /** * {@inheritdoc} */ public function denormalize($data, $class, $format = null, array $context = array()) { $object = $this->extractObjectToPopulate($class, $context) ?: new $class(); $object->denormalize($this->serializer, $data, $format, $context); return $object; } /** * Checks if the given class implements the NormalizableInterface. * * @param mixed $data Data to normalize * @param string $format The format being (de-)serialized from or into * * @return bool */ public function supportsNormalization($data, $format = null) { return $data instanceof NormalizableInterface; } /** * Checks if the given class implements the DenormalizableInterface. * * @param mixed $data Data to denormalize from * @param string $type The class to which the data should be denormalized * @param string $format The format being deserialized from * * @return bool */ public function supportsDenormalization($data, $type, $format = null) { if (isset($this->cache[$type])) { return $this->cache[$type]; } if (!class_exists($type)) { return $this->cache[$type] = false; } return $this->cache[$type] = is_subclass_of($type, 'Symfony\Component\Serializer\Normalizer\DenormalizableInterface'); } } __halt_compiler();----SIGNATURE:----W+wlF0EqSwa7DKzKgg0LSq6WolsDbo2P865yx2wQHf2LnrwqrUhRx9ZtHIxuHHfz/TqZi7tOCYvhK4AwoK0/zbWZBQ+y+9DY2xFqOdIXol25aPK9uVAd4eYXGwUCASunxR6KQcIZaJEgLklO3Q5OmuHxlNtrIrHrBtcTwdKEb209p4gY+jITMehoBsghZAhVM+RoONWUXKWV6RmyDo1Rb+K6a8f+UUCvSG00Pzt/cObGAoxi0jRF7TnJBPWxXlb+0K85OkS9mCAMZObroIurLPmDSNTGEEPZcRyVMYk45UhMKxwTaRGEuRsUnI3OTOkvlXYxjGBoXicjrqpsWmpO0hYzdgB5mt7eqcFFEvoqJ/MZsyDxN60Bu79Sj+tbUI85IlwEe/m91ojz9UEsluvUO3F8jU+4iufEwPEls6rYDTc4jRfIn4OoBSFIIe1BoSWFbt1xhNkQU66I8UFe0VUBM3qwJJ+V2Sy3B6f3wEAHTEnp+IqSnebVFcXgZ94vOaIiR9NR0f/LwrL6ds/Kaz72zYDjr/uKHMzD4CobvYClBwGvwVMoNl8Fw6uIFIdNFuyL6jXiT4wPlp2rM6uDxxxpbJpft4yo0m6sMT/mcGWX7SkRfqczJcsaQQe2aSOjF3RAFMixvWrCtv4CDzd/GyRpzw49bTxsygr4/Hfyv8qqAyg=----ATTACHMENT:----MTcxNDk2NDU2NjgyNTUwMiAyOTYyMzkxMTIxNTIyMzc1IDQ3MzYzMjk2OTAzNDQ0OTY=