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 https://github.com/symfony/symfony/pull/29832
Commits
-------
0b44ad79c6
[Serializer] Docblock about throwing exceptions on serializer
This commit is contained in:
commit
dc6a3bb176
@ -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,6 +42,7 @@ 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 = []);
|
||||
|
||||
|
@ -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,6 +36,7 @@ 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 = []);
|
||||
|
||||
|
Reference in New Issue
Block a user