Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/serializer/Encoder/JsonDecode.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 |
---|---|
62 * | 62 * |
63 * @throws NotEncodableValueException | 63 * @throws NotEncodableValueException |
64 * | 64 * |
65 * @see http://php.net/json_decode json_decode | 65 * @see http://php.net/json_decode json_decode |
66 */ | 66 */ |
67 public function decode($data, $format, array $context = array()) | 67 public function decode($data, $format, array $context = []) |
68 { | 68 { |
69 $context = $this->resolveContext($context); | 69 $context = $this->resolveContext($context); |
70 | 70 |
71 $associative = $context['json_decode_associative']; | 71 $associative = $context['json_decode_associative']; |
72 $recursionDepth = $context['json_decode_recursion_depth']; | 72 $recursionDepth = $context['json_decode_recursion_depth']; |
94 * | 94 * |
95 * @return array | 95 * @return array |
96 */ | 96 */ |
97 private function resolveContext(array $context) | 97 private function resolveContext(array $context) |
98 { | 98 { |
99 $defaultOptions = array( | 99 $defaultOptions = [ |
100 'json_decode_associative' => $this->associative, | 100 'json_decode_associative' => $this->associative, |
101 'json_decode_recursion_depth' => $this->recursionDepth, | 101 'json_decode_recursion_depth' => $this->recursionDepth, |
102 'json_decode_options' => 0, | 102 'json_decode_options' => 0, |
103 ); | 103 ]; |
104 | 104 |
105 return array_merge($defaultOptions, $context); | 105 return array_merge($defaultOptions, $context); |
106 } | 106 } |
107 } | 107 } |