Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/serializer/Normalizer/ArrayDenormalizer.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 |
line wrap: on
line diff
--- a/vendor/symfony/serializer/Normalizer/ArrayDenormalizer.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/serializer/Normalizer/ArrayDenormalizer.php Thu Feb 28 13:21:36 2019 +0000 @@ -36,13 +36,13 @@ * * @throws NotNormalizableValueException */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (null === $this->serializer) { throw new BadMethodCallException('Please set a serializer before calling denormalize()!'); } - if (!is_array($data)) { - throw new InvalidArgumentException('Data expected to be an array, '.gettype($data).' given.'); + if (!\is_array($data)) { + throw new InvalidArgumentException('Data expected to be an array, '.\gettype($data).' given.'); } if ('[]' !== substr($class, -2)) { throw new InvalidArgumentException('Unsupported class: '.$class); @@ -53,8 +53,8 @@ $builtinType = isset($context['key_type']) ? $context['key_type']->getBuiltinType() : null; foreach ($data as $key => $value) { - if (null !== $builtinType && !call_user_func('is_'.$builtinType, $key)) { - throw new NotNormalizableValueException(sprintf('The type of the key "%s" must be "%s" ("%s" given).', $key, $builtinType, gettype($key))); + if (null !== $builtinType && !\call_user_func('is_'.$builtinType, $key)) { + throw new NotNormalizableValueException(sprintf('The type of the key "%s" must be "%s" ("%s" given).', $key, $builtinType, \gettype($key))); } $data[$key] = $serializer->denormalize($value, $class, $format, $context); @@ -66,9 +66,9 @@ /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null/*, array $context = array()*/) + public function supportsDenormalization($data, $type, $format = null/*, array $context = []*/) { - $context = \func_num_args() > 3 ? func_get_arg(3) : array(); + $context = \func_num_args() > 3 ? func_get_arg(3) : []; return '[]' === substr($type, -2) && $this->serializer->supportsDenormalization($data, substr($type, 0, -2), $format, $context);