@@ -75,7 +75,7 @@ public function __construct(array $normalizers = array(), array $encoders = arra
75
75
final public function serialize ($ data , $ format , array $ context = array ())
76
76
{
77
77
if (!$ this ->supportsEncoding ($ format )) {
78
- throw new UnexpectedValueException ('Serialization for the format ' . $ format . ' is not supported ' );
78
+ throw new UnexpectedValueException (sprintf ( 'Serialization for the format %s is not supported ' , $ format ) );
79
79
}
80
80
81
81
if ($ this ->encoder ->needsNormalization ($ format )) {
@@ -91,7 +91,7 @@ final public function serialize($data, $format, array $context = array())
91
91
final public function deserialize ($ data , $ type , $ format , array $ context = array ())
92
92
{
93
93
if (!$ this ->supportsDecoding ($ format )) {
94
- throw new UnexpectedValueException ('Deserialization for the format ' . $ format . ' is not supported ' );
94
+ throw new UnexpectedValueException (sprintf ( 'Deserialization for the format %s is not supported ' , $ format ) );
95
95
}
96
96
97
97
$ data = $ this ->decode ($ data , $ format , $ context );
@@ -128,7 +128,7 @@ public function normalize($data, $format = null, array $context = array())
128
128
129
129
return $ data ;
130
130
}
131
- throw new UnexpectedValueException ('An unexpected value could not be normalized: ' . var_export ($ data , true ));
131
+ throw new UnexpectedValueException (sprintf ( 'An unexpected value could not be normalized: %s ' , var_export ($ data , true ) ));
132
132
}
133
133
134
134
/**
@@ -246,7 +246,7 @@ private function normalizeObject($object, $format = null, array $context = array
246
246
}
247
247
}
248
248
249
- throw new UnexpectedValueException ('Could not normalize object of type ' . $ class . ' , no supporting normalizer found. ' );
249
+ throw new UnexpectedValueException (sprintf ( 'Could not normalize object of type %s , no supporting normalizer found. ' , $ class ) );
250
250
}
251
251
252
252
/**
@@ -280,7 +280,7 @@ private function denormalizeObject($data, $class, $format = null, array $context
280
280
}
281
281
}
282
282
283
- throw new UnexpectedValueException ('Could not denormalize object of type ' . $ class . ' , no supporting normalizer found. ' );
283
+ throw new UnexpectedValueException (sprintf ( 'Could not denormalize object of type %s , no supporting normalizer found. ' , $ class ) );
284
284
}
285
285
286
286
/**
0 commit comments