Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/serializer/Normalizer/CustomNormalizer.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
20 class CustomNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface | 20 class CustomNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface |
21 { | 21 { |
22 use ObjectToPopulateTrait; | 22 use ObjectToPopulateTrait; |
23 use SerializerAwareTrait; | 23 use SerializerAwareTrait; |
24 | 24 |
25 private $cache = array(); | 25 private $cache = []; |
26 | 26 |
27 /** | 27 /** |
28 * {@inheritdoc} | 28 * {@inheritdoc} |
29 */ | 29 */ |
30 public function normalize($object, $format = null, array $context = array()) | 30 public function normalize($object, $format = null, array $context = []) |
31 { | 31 { |
32 return $object->normalize($this->serializer, $format, $context); | 32 return $object->normalize($this->serializer, $format, $context); |
33 } | 33 } |
34 | 34 |
35 /** | 35 /** |
36 * {@inheritdoc} | 36 * {@inheritdoc} |
37 */ | 37 */ |
38 public function denormalize($data, $class, $format = null, array $context = array()) | 38 public function denormalize($data, $class, $format = null, array $context = []) |
39 { | 39 { |
40 $object = $this->extractObjectToPopulate($class, $context) ?: new $class(); | 40 $object = $this->extractObjectToPopulate($class, $context) ?: new $class(); |
41 $object->denormalize($this->serializer, $data, $format, $context); | 41 $object->denormalize($this->serializer, $data, $format, $context); |
42 | 42 |
43 return $object; | 43 return $object; |