12
12
namespace Symfony \Component \Serializer ;
13
13
14
14
use Symfony \Component \Serializer \Exception \ExceptionInterface ;
15
- use Symfony \Component \Serializer \Exception \NotEncodableValueException ;
16
15
use Symfony \Component \Serializer \Exception \NotNormalizableValueException ;
16
+ use Symfony \Component \Serializer \Exception \UnexpectedValueException ;
17
17
18
18
/**
19
19
* @author Jordi Boggiano <j.boggiano@seld.be>
@@ -25,8 +25,8 @@ interface SerializerInterface
25
25
*
26
26
* @param array<string, mixed> $context Options normalizers/encoders have access to
27
27
*
28
- * @throws NotEncodableValueException Occurs when the format is not supported for serialization
29
28
* @throws NotNormalizableValueException Occurs when a value cannot be normalized
29
+ * @throws UnexpectedValueException Occurs when a value cannot be encoded
30
30
* @throws ExceptionInterface Occurs for all the other cases of serialization-related errors
31
31
*/
32
32
public function serialize (mixed $ data , string $ format , array $ context = []): string ;
@@ -44,8 +44,8 @@ public function serialize(mixed $data, string $format, array $context = []): str
44
44
*
45
45
* @phpstan-return ($type is class-string<TObject> ? TObject : mixed)
46
46
*
47
- * @throws NotEncodableValueException Occurs when the format is not supported for deserialization
48
47
* @throws NotNormalizableValueException Occurs when a value cannot be denormalized
48
+ * @throws UnexpectedValueException Occurs when a value cannot be decoded
49
49
* @throws ExceptionInterface Occurs for all the other cases of serialization-related errors
50
50
*/
51
51
public function deserialize (mixed $ data , string $ type , string $ format , array $ context = []): mixed ;
0 commit comments