@@ -260,13 +260,10 @@ private function validateAndDenormalize($currentClass, $attribute, $data, $forma
260
260
//
261
261
// This is special to xml and csv format
262
262
if (
263
- \is_string ($ data ) &&
264
- (XmlEncoder::FORMAT === $ format || CsvEncoder::FORMAT === $ format )
263
+ \is_string ($ data ) && (XmlEncoder::FORMAT === $ format || CsvEncoder::FORMAT === $ format )
265
264
) {
266
265
if (
267
- '' === $ data &&
268
- $ type ->isNullable () &&
269
- \in_array ($ type ->getBuiltinType (), [Type::BUILTIN_TYPE_BOOL , Type::BUILTIN_TYPE_INT , Type::BUILTIN_TYPE_FLOAT ], true )
266
+ '' === $ data && $ type ->isNullable () && \in_array ($ type ->getBuiltinType (), [Type::BUILTIN_TYPE_BOOL , Type::BUILTIN_TYPE_INT , Type::BUILTIN_TYPE_FLOAT ], true )
270
267
) {
271
268
return null ;
272
269
}
@@ -285,7 +282,7 @@ private function validateAndDenormalize($currentClass, $attribute, $data, $forma
285
282
case Type::BUILTIN_TYPE_INT :
286
283
if (
287
284
ctype_digit ($ data ) ||
288
- '- ' == $ data [0 ] && ctype_digit (substr ($ data , 1 ))
285
+ '- ' === $ data [0 ] && ctype_digit (substr ($ data , 1 ))
289
286
) {
290
287
$ data = (int ) $ data ;
291
288
} else {
@@ -462,10 +459,10 @@ private function getCacheKey($format, array $context)
462
459
unset($ context ['cache_key ' ]); // avoid artificially different keys
463
460
try {
464
461
return md5 ($ format .serialize ([
465
- 'context ' => $ context ,
466
- 'ignored ' => $ this ->ignoredAttributes ,
467
- 'camelized ' => $ this ->camelizedAttributes ,
468
- ]));
462
+ 'context ' => $ context ,
463
+ 'ignored ' => $ this ->ignoredAttributes ,
464
+ 'camelized ' => $ this ->camelizedAttributes ,
465
+ ]));
469
466
} catch (\Exception $ exception ) {
470
467
// The context cannot be serialized, skip the cache
471
468
return false ;
0 commit comments