[Serializer] Docblock about throwing exceptions on serializer

This commit is contained in:
George Mponos 2019-01-14 23:07:15 +02:00 committed by Kévin Dunglas
parent 7789a99968
commit 0b44ad79c6
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6
2 changed files with 6 additions and 2 deletions

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Serializer\Normalizer;
use Symfony\Component\Serializer\Exception\BadMethodCallException;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Exception\LogicException;
@ -41,8 +42,9 @@ interface DenormalizerInterface
* @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
* @throws ExceptionInterface Occurs for all the other cases of errors
*/
public function denormalize($data, $class, $format = null, array $context = array());
public function denormalize($data, $class, $format = null, array $context = []);
/**
* Checks whether the given class is supported for denormalization by this normalizer.

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Serializer\Normalizer;
use Symfony\Component\Serializer\Exception\CircularReferenceException;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Exception\LogicException;
@ -35,8 +36,9 @@ interface NormalizerInterface
* @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
* @throws ExceptionInterface Occurs for all the other cases of errors
*/
public function normalize($object, $format = null, array $context = array());
public function normalize($object, $format = null, array $context = []);
/**
* Checks whether the given class is supported for normalization by this normalizer.