Browse Source

Added $format in serialize() method, to keep consistence and give a hint to the normalizer.

Oncle Tom 13 năm trước cách đây
mục cha
commit
ae55a98604

+ 1 - 1
src/Symfony/Component/Serializer/Serializer.php

@@ -69,7 +69,7 @@ class Serializer implements SerializerInterface
         $encoder = $this->getEncoder($format);
         $encoder = $this->getEncoder($format);
 
 
         if (!$encoder instanceof NormalizationAwareInterface) {
         if (!$encoder instanceof NormalizationAwareInterface) {
-            $data = $this->normalize($data);
+            $data = $this->normalize($data, $format);
         }
         }
 
 
         return $this->encode($data, $format);
         return $this->encode($data, $format);