Skip to content

Commit dc6a3bb

Browse files
committed
minor #29889 [Serializer] Docblock about throwing exceptions on serializer (gmponos)
This PR was squashed before being merged into the 3.4 branch (closes #29889). Discussion ---------- [Serializer] Docblock about throwing exceptions on serializer | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Most of the serializers can throw a `\Symfony\Component\Serializer\ExceptionInterface`. This makes the docblock in line with that. Similar to this #29832 Commits ------- 0b44ad7 [Serializer] Docblock about throwing exceptions on serializer
2 parents a5dd57f + 0b44ad7 commit dc6a3bb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

+2
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,6 +42,7 @@ 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
*/
4547
public function denormalize($data, $class, $format = null, array $context = []);
4648

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

+2
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,6 +36,7 @@ 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
*/
3941
public function normalize($object, $format = null, array $context = []);
4042

0 commit comments

Comments
 (0)