Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / serializer / Serializer.php
index 0259bfeda644191ae072771114b33810e05ad03f..c3e35bb0267cc2288de4c941c09440a649bc8fed 100644 (file)
@@ -15,6 +15,8 @@ use Symfony\Component\Serializer\Encoder\ChainDecoder;
 use Symfony\Component\Serializer\Encoder\ChainEncoder;
 use Symfony\Component\Serializer\Encoder\EncoderInterface;
 use Symfony\Component\Serializer\Encoder\DecoderInterface;
+use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
+use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
 use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
 use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
 use Symfony\Component\Serializer\Exception\LogicException;
@@ -54,11 +56,15 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
 
     /**
      * @var array
+     *
+     * @deprecated since 3.1 will be removed in 4.0
      */
     protected $normalizerCache = array();
 
     /**
      * @var array
+     *
+     * @deprecated since 3.1 will be removed in 4.0
      */
     protected $denormalizerCache = array();
 
@@ -68,6 +74,14 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
             if ($normalizer instanceof SerializerAwareInterface) {
                 $normalizer->setSerializer($this);
             }
+
+            if ($normalizer instanceof DenormalizerAwareInterface) {
+                $normalizer->setDenormalizer($this);
+            }
+
+            if ($normalizer instanceof NormalizerAwareInterface) {
+                $normalizer->setNormalizer($this);
+            }
         }
         $this->normalizers = $normalizers;