Skip to content

Commit 0b44ad7

Browse files
gmponosdunglas
authored andcommitted
[Serializer] Docblock about throwing exceptions on serializer
1 parent 7789a99 commit 0b44ad7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
use Symfony\Component\Serializer\Exception\BadMethodCallException;
15+
use Symfony\Component\Serializer\Exception\ExceptionInterface;
1516
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
1617
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
1718
use Symfony\Component\Serializer\Exception\LogicException;
@@ -41,8 +42,9 @@ interface DenormalizerInterface
4142
* @throws ExtraAttributesException Occurs when the item doesn't have attribute to receive given data
4243
* @throws LogicException Occurs when the normalizer is not supposed to denormalize
4344
* @throws RuntimeException Occurs if the class cannot be instantiated
45+
* @throws ExceptionInterface Occurs for all the other cases of errors
4446
*/
45-
public function denormalize($data, $class, $format = null, array $context = array());
47+
public function denormalize($data, $class, $format = null, array $context = []);
4648

4749
/**
4850
* Checks whether the given class is supported for denormalization by this normalizer.

src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
use Symfony\Component\Serializer\Exception\CircularReferenceException;
15+
use Symfony\Component\Serializer\Exception\ExceptionInterface;
1516
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
1617
use Symfony\Component\Serializer\Exception\LogicException;
1718

@@ -35,8 +36,9 @@ interface NormalizerInterface
3536
* @throws CircularReferenceException Occurs when the normalizer detects a circular reference when no circular
3637
* reference handler can fix it
3738
* @throws LogicException Occurs when the normalizer is not called in an expected context
39+
* @throws ExceptionInterface Occurs for all the other cases of errors
3840
*/
39-
public function normalize($object, $format = null, array $context = array());
41+
public function normalize($object, $format = null, array $context = []);
4042

4143
/**
4244
* Checks whether the given class is supported for normalization by this normalizer.

0 commit comments

Comments
 (0)