getContext(); $base = new BaseContext('JSON Decode'); $base->depth = $c->getDepth(); if (null !== ($ap = $c->getAccessPath())) { $base->access_path = 'json_decode('.$ap.', true)'; } $json = $this->getParser()->parse($json, $base); if ($json instanceof ArrayValue && (~$json->flags & AbstractValue::FLAG_DEPTH_LIMIT) && $contents = $json->getContents()) { foreach ($contents as $value) { $value->flags |= AbstractValue::FLAG_GENERATED; } $v->addRepresentation(new ContainerRepresentation('Json', $contents), 0); } else { $json->flags |= AbstractValue::FLAG_GENERATED; $v->addRepresentation(new ValueRepresentation('Json', $json), 0); } return $v; } }