|
@@ -84,33 +84,25 @@ interface SerializerInterface
|
|
|
function decode($data, $format);
|
|
|
|
|
|
/**
|
|
|
- * Normalizes an object into a set of arrays/scalars
|
|
|
+ * Checks whether the serializer can serialize the given format
|
|
|
*
|
|
|
- * @param object $object object to normalize
|
|
|
- * @param string $format format name, present to give the option to normalizers to act differently based on formats
|
|
|
- * @return array|scalar
|
|
|
+ * @param string $format format name
|
|
|
+ * @return Boolean
|
|
|
*/
|
|
|
- function normalizeObject($object, $format = null);
|
|
|
+ function supportsSerialization($format);
|
|
|
|
|
|
/**
|
|
|
- * Denormalizes data back into an object of the given class
|
|
|
+ * Checks whether the serializer can deserialize the given format
|
|
|
*
|
|
|
- * @param mixed $data data to restore
|
|
|
- * @param string $class the expected class to instantiate
|
|
|
- * @param string $format format name, present to give the option to normalizers to act differently based on formats
|
|
|
- * @return object
|
|
|
- */
|
|
|
- function denormalizeObject($data, $class, $format = null);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param NormalizerInterface $normalizer
|
|
|
+ * @param string $format format name
|
|
|
+ * @return Boolean
|
|
|
*/
|
|
|
- function addNormalizer(NormalizerInterface $normalizer);
|
|
|
+ function supportsDeserialization($format);
|
|
|
|
|
|
/**
|
|
|
- * @param NormalizerInterface $normalizer
|
|
|
+ * @return EncoderInterface
|
|
|
*/
|
|
|
- function removeNormalizer(NormalizerInterface $normalizer);
|
|
|
+ function getEncoder($format);
|
|
|
|
|
|
/**
|
|
|
* @param string $format format name
|
|
@@ -119,28 +111,17 @@ interface SerializerInterface
|
|
|
function setEncoder($format, EncoderInterface $encoder);
|
|
|
|
|
|
/**
|
|
|
- * @return EncoderInterface
|
|
|
- */
|
|
|
- function getEncoder($format);
|
|
|
-
|
|
|
- /**
|
|
|
- * Checks whether the serializer can serialize the given format
|
|
|
- *
|
|
|
* @param string $format format name
|
|
|
- * @return Boolean
|
|
|
*/
|
|
|
- function supportsSerialization($format);
|
|
|
+ function removeEncoder($format);
|
|
|
|
|
|
/**
|
|
|
- * Checks whether the serializer can deserialize the given format
|
|
|
- *
|
|
|
- * @param string $format format name
|
|
|
- * @return Boolean
|
|
|
+ * @param NormalizerInterface $normalizer
|
|
|
*/
|
|
|
- function supportsDeserialization($format);
|
|
|
+ function addNormalizer(NormalizerInterface $normalizer);
|
|
|
|
|
|
/**
|
|
|
- * @param string $format format name
|
|
|
+ * @param NormalizerInterface $normalizer
|
|
|
*/
|
|
|
- function removeEncoder($format);
|
|
|
+ function removeNormalizer(NormalizerInterface $normalizer);
|
|
|
}
|