|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
namespace Symfony\Component\Serializer\Normalizer;
|
|
namespace Symfony\Component\Serializer\Normalizer;
|
|
|
|
|
|
|
|
+use Symfony\Component\Serializer\SerializerInterface;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* This file is part of the Symfony framework.
|
|
* This file is part of the Symfony framework.
|
|
*
|
|
*
|
|
@@ -27,14 +29,13 @@ interface NormalizableInterface
|
|
* It is important to understand that the normalize() call should normalize
|
|
* It is important to understand that the normalize() call should normalize
|
|
* recursively all child objects of the implementor.
|
|
* recursively all child objects of the implementor.
|
|
*
|
|
*
|
|
- * @param NormalizerInterface $normalizer The normalizer is given so that you
|
|
|
|
- * can use it to normalize objects contained within this object, eventually
|
|
|
|
- * grabbing the serializer from it to access other normalizers.
|
|
|
|
|
|
+ * @param SerializerInterface $serializer The serializer is given so that you
|
|
|
|
+ * can use it to normalize objects contained within this object.
|
|
* @param string|null $format The format is optionally given to be able to normalize differently
|
|
* @param string|null $format The format is optionally given to be able to normalize differently
|
|
* based on different output formats.
|
|
* based on different output formats.
|
|
* @return array|scalar
|
|
* @return array|scalar
|
|
*/
|
|
*/
|
|
- function normalize(NormalizerInterface $normalizer, $format);
|
|
|
|
|
|
+ function normalize(SerializerInterface $serializer, $format = null);
|
|
|
|
|
|
/**
|
|
/**
|
|
* Denormalizes the object back from an array of scalars|arrays.
|
|
* Denormalizes the object back from an array of scalars|arrays.
|
|
@@ -42,12 +43,11 @@ interface NormalizableInterface
|
|
* It is important to understand that the normalize() call should denormalize
|
|
* It is important to understand that the normalize() call should denormalize
|
|
* recursively all child objects of the implementor.
|
|
* recursively all child objects of the implementor.
|
|
*
|
|
*
|
|
- * @param NormalizerInterface $normalizer The normalizer is given so that you
|
|
|
|
- * can use it to denormalize objects contained within this object, eventually
|
|
|
|
- * grabbing the serializer from it to access other normalizers.
|
|
|
|
|
|
+ * @param SerializerInterface $serializer The serializer is given so that you
|
|
|
|
+ * can use it to denormalize objects contained within this object.
|
|
* @param array|scalar $data The data from which to re-create the object.
|
|
* @param array|scalar $data The data from which to re-create the object.
|
|
* @param string|null $format The format is optionally given to be able to denormalize differently
|
|
* @param string|null $format The format is optionally given to be able to denormalize differently
|
|
* based on different input formats.
|
|
* based on different input formats.
|
|
*/
|
|
*/
|
|
- function denormalize(NormalizerInterface $normalizer, $data, $format = null);
|
|
|
|
|
|
+ function denormalize(SerializerInterface $serializer, $data, $format = null);
|
|
}
|
|
}
|