Browse Source

[Serializer] Added @api annotations

Jordi Boggiano 14 năm trước cách đây
mục cha
commit
54ffb1fbc0

+ 4 - 0
src/Symfony/Component/Serializer/Encoder/EncoderInterface.php

@@ -26,6 +26,7 @@ interface EncoderInterface
      * @param mixed $data data to encode
      * @param string $format format to encode to
      * @return string
+     * @api
      */
     function encode($data, $format);
 
@@ -35,6 +36,7 @@ interface EncoderInterface
      * @param string $data data to decode
      * @param string $format format to decode from
      * @return mixed
+     * @api
      */
     function decode($data, $format);
 
@@ -42,6 +44,7 @@ interface EncoderInterface
      * Sets the owning Serializer object
      *
      * @param SerializerInterface $serializer
+     * @api
      */
     function setSerializer(SerializerInterface $serializer);
 
@@ -49,6 +52,7 @@ interface EncoderInterface
      * Gets the owning Serializer object
      *
      * @return SerializerInterface
+     * @api
      */
     function getSerializer();
 }

+ 5 - 0
src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php

@@ -27,6 +27,7 @@ interface NormalizerInterface
      * @param string $format format the normalization result will be encoded as
      * @param array $properties a list of properties to extract, if null all properties are returned
      * @return array|scalar
+     * @api
      */
     function normalize($object, $format, $properties = null);
 
@@ -37,6 +38,7 @@ interface NormalizerInterface
      * @param string $class the expected class to instantiate
      * @param string $format format the given data was extracted from
      * @return object
+     * @api
      */
     function denormalize($data, $class, $format = null);
 
@@ -46,6 +48,7 @@ interface NormalizerInterface
      * @param ReflectionClass $class
      * @param string $format format the given data was extracted from
      * @return Boolean
+     * @api
      */
     function supports(\ReflectionClass $class, $format = null);
 
@@ -53,6 +56,7 @@ interface NormalizerInterface
      * Sets the owning Serializer object
      *
      * @param SerializerInterface $serializer
+     * @api
      */
     function setSerializer(SerializerInterface $serializer);
 
@@ -60,6 +64,7 @@ interface NormalizerInterface
      * Gets the owning Serializer object
      *
      * @return SerializerInterface
+     * @api
      */
     function getSerializer();
 }

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

@@ -27,6 +27,7 @@ interface SerializerInterface
      * @param mixed $data any data
      * @param string $format format name
      * @return string
+     * @api
      */
     function serialize($data, $format);
 
@@ -36,6 +37,7 @@ interface SerializerInterface
      * @param mixed $data data to normalize
      * @param string $format format name, present to give the option to normalizers to act differently based on formats
      * @return array|scalar
+     * @api
      */
     function normalize($data, $format);
 
@@ -65,6 +67,7 @@ interface SerializerInterface
      * @param mixed $data data to encode
      * @param string $format format name
      * @return array|scalar
+     * @api
      */
     function encode($data, $format);
 
@@ -74,10 +77,10 @@ interface SerializerInterface
      * @param string $data data to decode
      * @param string $format format name
      * @return mixed
+     * @api
      */
     function decode($data, $format);
 
-
     /**
      * @param NormalizerInterface $normalizer
      */