diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php index 2b3433c567..188b79ade8 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Serializer\Normalizer; use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Encoder\JsonEncoder; -use Symfony\Component\Serializer\Exception\CircularReferenceException; use Symfony\Component\Serializer\Exception\LogicException; use Symfony\Component\Serializer\Exception\UnexpectedValueException; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; @@ -52,8 +51,6 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer /** * {@inheritdoc} - * - * @throws CircularReferenceException */ public function normalize($object, $format = null, array $context = array()) { diff --git a/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php index 7d3d87c510..9217d51a95 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php @@ -31,8 +31,6 @@ class ArrayDenormalizer implements DenormalizerInterface, SerializerAwareInterfa /** * {@inheritdoc} - * - * @throws UnexpectedValueException */ public function denormalize($data, $class, $format = null, array $context = array()) { diff --git a/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php index 988a491b7c..9e5af130d0 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php @@ -79,9 +79,6 @@ class DataUriNormalizer implements NormalizerInterface, DenormalizerInterface * Regex adapted from Brian Grinstead code. * * @see https://gist.github.com/bgrins/6194623 - * - * @throws InvalidArgumentException - * @throws UnexpectedValueException */ public function denormalize($data, $class, $format = null, array $context = array()) { diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php index 23df4829a8..2b3b206287 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -11,6 +11,13 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\BadMethodCallException; +use Symfony\Component\Serializer\Exception\ExtraAttributesException; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; +use Symfony\Component\Serializer\Exception\LogicException; +use Symfony\Component\Serializer\Exception\RuntimeException; +use Symfony\Component\Serializer\Exception\UnexpectedValueException; + /** * Defines the interface of denormalizers. * @@ -27,6 +34,13 @@ interface DenormalizerInterface * @param array $context options available to the denormalizer * * @return object + * + * @throws BadMethodCallException Occurs when the normalizer is not called in an expected context + * @throws InvalidArgumentException Occurs when the arguments are not coherent or not supported + * @throws UnexpectedValueException Occurs when the item cannot be hydrated with the given data + * @throws ExtraAttributesException Occurs when the item doesn't have attribute to receive given data + * @throws LogicException Occurs when the normalizer is not supposed to denormalize + * @throws RuntimeException Occurs if the class cannot be instantiated */ public function denormalize($data, $class, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php index f7007840da..2779053f74 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -11,6 +11,10 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\CircularReferenceException; +use Symfony\Component\Serializer\Exception\InvalidArgumentException; +use Symfony\Component\Serializer\Exception\LogicException; + /** * Defines the interface of normalizers. * @@ -26,6 +30,11 @@ interface NormalizerInterface * @param array $context Context options for the normalizer * * @return array|scalar + * + * @throws InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer + * @throws CircularReferenceException Occurs when the normalizer detects a circular reference when no circular + * reference handler can fix it + * @throws LogicException Occurs when the normalizer is not called in an expected context */ public function normalize($object, $format = null, array $context = array());