deserialize a value that contains personal data

@param string $type
@param string $json
@return SerializablePersonalDataValue
764708
public function deserializePersonalValue(string $type, string $json): SerializablePersonalDataValue {
        $values = json_decode($json);

        $personalKey = PersonalKey::deserialize($values->personalKey);
        $dataKey     = PersonalDataKey::deserialize($values->dataKey);
        
        return $type::deserialize($this->dataStore->retrieveData($personalKey, $dataKey)->toString());
    }
963590
public static function createFromJSON($json_data, $type = null)
    {
        $className = explode('\\', $type);
        $className = lcfirst(end($className));

        $allFields = parent::createFromJSON($json_data, $type);
        $compositeFields = CompositeDTOMapper::compositeFields(get_class($allFields));
        foreach ($compositeFields as $key) {
            if (isset($allFields->$key)) {
                $allFields->$key = self::synthesizeSubresource($key, $json_data[$key], $className);
            }
        }
        return $allFields;

    }
411355
public static function parse($json)
    {
        $json = json_decode($json);

        if (!isset($json->status)) {
            throw new JSendParseException('Could not parse data; required element \'status\' missing.');
        }

        $instance = new static($json->status);

        if (!isset($json->code)) {
            $json->code = 200;
        }
        $instance->setCode($json->code);

        if ($instance->isError()) {
            if (!isset($json->message)) {
                throw new JSendParseException('Could not parse data; required element \'message\' missing.');
            }
            $instance->setMessage($json->message);
        }

        if ($instance->isSuccess() || $instance->isFail()) {
            if (!isset($json->data)) {
                throw new JSendParseException('Could not parse data; required element \'data\' missing.');
            }
            $instance->setData($json->data);
        } else {
            if ($instance->isError()) {
                if (isset($json->data)) {
                    $instance->setData($json->data);
                }
            }
        }

        return $instance;
    }
743808
private function setJsonData(?string $json): self
    {
        $this->updatePropertyValue(
            JsonDataFieldInterface::PROP_JSON_DATA,
            $json
        );

        return $this;
    }
386378
public function deserializeHashFromJson(
        JsonDeserializationVisitor $visitor,
        array $data,
        array $type,
        Context $context
    ) {
        $currentPath = $context->getCurrentPath();
        $currentRequestContent = $this->getCurrentRequestContent();
        $dataObj = null;

        if (!is_null($currentRequestContent)) {
            $dataObj = $currentRequestContent;
            foreach ($currentPath as $pathElement) {
                if (isset($dataObj->{$pathElement})) {
                    $dataObj = $dataObj->{$pathElement};
                } else {
                    $dataObj = null;
                    break;
                }
            }
        }

        if (!is_null($dataObj)) {
            if ($this->isSequentialArrayCase($dataObj, $data)) {
                $dataObj = $dataObj[$this->getLocationCounter($currentPath)];
            }

            $data = $dataObj;
        }

        return new Hash($visitor->visitArray((array) $data, $type, $context));
    }
381851
protected function extractOne(array $json, array $data)
    {
        if ($this->dataHasType($data)) {
            return $this->createInstanceWithRelations($json, $data);
        }
        throw new JsonApiExtractException('No data type provided');
    }
1021925
public static CompleteRestoreBridgeResult deserialize(String json) {
        JaxbJsonSerializer<CompleteRestoreBridgeResult> serializer =
            new JaxbJsonSerializer<>(CompleteRestoreBridgeResult.class);
        try {
            return serializer.deserialize(json);
        } catch (IOException e) {
            throw new SnapshotDataException(
                "Unable to create result due to: " + e.getMessage());
        }
    }
429355
public static function get_Json( &$json )
    {
        if( $json instanceof Json ) {
            return $json;
        }
        return !is_null($json)
            ? new Json($json)
            : null
            ;
    }
515812
@Override
    public T deserialize(String json) {
        ObjectMapper mapper = SequenceElement.mapper();
        try {
            T ret = (T) mapper.readValue(json, targetClass);
            return ret;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
470690
public function deserializeArrayObjectFromJson(
        JsonDeserializationVisitor $visitor,
        array $data,
        array $type,
        Context $context
    ) {
        return new \ArrayObject($visitor->visitArray($data, $type, $context));
    }
372552
public static function fromJson(string $json): self
    {
        $input = json_decode($json, true);
        $data = reset($input);
        $locale = key($input);
        
        return new self($locale, $data);
    }
764099
protected function unserializeType($value, $type)
    {
        if ($type === self::TYPE_JSON) {
            // overwrite the doctrine json type since it uses the assoc
            // parameter. This is a problem for empty objects since we cant
            // distinguish between an empty array or object
            if ($value === null) {
                return null;
            } elseif ($value === '') {
                return new \stdClass();
            } elseif (is_resource($value)) {
                $value = stream_get_contents($value);
            }

            return json_decode($value);
        } else {
            return $this->connection->convertToPHPValue(
                $value,
                TypeMapper::getDoctrineTypeByType($type)
            );
        }
    }
537630
public static function deserialize($json)
    {
        $data = json_decode($json);

        $template = new WidevineMessage();
        foreach ($data as $key => $value) {
            if ($key == 'content_key_specs') {
                $specs = [];
                foreach ($value as $child) {
                    $spec = new ContentKeySpecs();
                    foreach ($child as $cKey => $cValue) {
                        if ($cKey == 'required_output_protection') {
                            $rop = new RequiredOutputProtection();
                            if (isset($cValue->hdcp)) {
                                $rop->hdcp = $cValue->hdcp;
                            }
                            $spec->{$cKey} = $rop;
                        } else {
                            $spec->{$cKey} = $cValue;
                        }
                    }
                    $specs[] = $spec;
                }
                $template->content_key_specs = $specs;
            } else {
                $template->{$key} = $value;
            }
        }

        return $template;
    }
1371999
public static function get($key, $type = 'ses')
    {
        $sessionData = $GLOBALS['TSFE']->fe_user->getKey(self::isType($type), $key);

        return unserialize($sessionData);
    }
1272112
public static function decode(string $json)
    {
        $value = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);

        if ($error = json_last_error()) {
            throw new JsonException(json_last_error_msg(), $error);
        }

        return $value;
    }
1294186
public static function jsonDeserialize( $json ) {
		$self = new LogList();
		foreach ( $json as $logJson ) {
			$self->addLog( Log::jsonDeserialize( $logJson ) );
		}
		return $self;
	}
1143471
public function unserialize($value)
    {
        $this->reset();
        $data = json_decode($value, true);
        if ($data === null && json_last_error() != JSON_ERROR_NONE) {
            throw new JsonSerializerException('Invalid JSON to unserialize.');
        }

        if (mb_strpos($value, static::UTF8ENCODED_IDENTIFIER_KEY) !== false) {
            $data = $this->decodeNonUtf8FromUtf8($data);
        }

        return $this->unserializeData($data);
    }