@param string $data

@return array

@throws DeserializerRuntimeException
168304
public function decode(string $data): array
    {
        $rawData = [];
        parse_str($data, $rawData);

        if ('' !== $data && [] === $rawData) {
            throw DeserializerRuntimeException::createNotParsable($this->getContentType());
        }

        return $this->fixValues($rawData);
    }
849414
public function deserialize(array $data)
    {
        $original = $data;
        $this->deserializeTos($data);
        $data = $this->getJavascriptsData($data);
        $data = $this->getLogoData($data);
        unset($data['tos']['text']);
        //maybe move this somewhere else
        unset($data['archives']);

        $data = array_merge($this->serialize([Options::SERIALIZE_MINIMAL]), $data);
        ksort($data);
        $data = json_encode($data, JSON_PRETTY_PRINT);

        file_put_contents($this->filePath, $data);

        return $original;
    }
1320744
final public static function deserialize(array $data)
    {
        return Reconstitution::reconstitute()->objectFrom(
            get_called_class(),
            RecursiveSerializer::deserialize($data, self::deserializationCallbacks())
        );
    }
985337
protected function serializeItem($data) {
        if ($data instanceof IArrayable) {
            return $data->toArray();
        } else if ($data instanceof IJsonable) {
            return $data->toJson();
        } else if ($data instanceof IStringable) {
            return $data->toString();
        }

        return $data;
    }
647881
protected function unserializeData($data)
    {
        $value = null;
        // if we're not deserialised yet, do so
        if (is_string($data) && strlen($data) > 1) {
            // are we json encoded?
            if ($data{1} === ':') {
                $value = \unserialize($data);
            } else {
                $value = \json_decode($data, true);
            }
        }
        return $value;
    }
1341573
public static function fromSerialized($data)
    {
        if (!$data || !is_string($data)) {
            return null;
        }

        $decoded = json_decode($data, true);

        if (!is_array($decoded)) {
            return null;
        }

        return new self($decoded);
    }
486035
public static function unserialize( $data )
    {
        $data = json_decode( $data, true );
        return new static( $data[0], $data[1], $data[2], $data[3] );
    }
240982
public function decode(string $data): array
    {
        $document = new \DOMDocument();

        if (!@$document->loadXML($data)) {
            throw DeserializerRuntimeException::createNotParsable($this->getContentType());
        }

        return $this->transformType($document->getElementsByTagName('object')->item(0));
    }
494700
protected function postSerialization(array $data)
    {
        $this->formatScalarValues($data);
        RecursiveDeleteHelper::deleteKeys($data, [Serializer::CLASS_IDENTIFIER_KEY]);

        return $data;
    }
278648
public function decode($data)
    {
        $result = [];
        $offset = 0;
        $length = strlen($data);
        while ($offset < $length)
        {
            if (!strstr(substr($data, $offset), '|'))
            {
                return [];
            }
            $pos = strpos($data, '|', $offset);
            $num = $pos - $offset;
            $varname = substr($data, $offset, $num);
            $offset += $num + 1;
            $dataItem = unserialize(substr($data, $offset));
            $result[$varname] = $dataItem;
            $offset += strlen(serialize($dataItem));
        }
        return $result;
    }
795719
@SuppressWarnings("unchecked")
    public static <T> T deserialize(final byte[] data) {
        if (data == null) {
            return null;
        }
        try (final ByteArrayInputStream bais = new ByteArrayInputStream(data)) {
            final ObjectInputStream in = new ObjectInputStream(bais);
            return (T) in.readObject();
        } catch (final ClassNotFoundException ex) {
            throw new RuntimeException(ex);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
    }
982843
public function formatToItems(string $data): array
    {
        return array_map(function (array $item) {
            $itemAsArray = [
                'uuid' => [
                    'id' => $item[0],
                    'type' => $item[1],
                ],
                'metadata' => $item[2],
                'indexed_metadata' => $item[3],
                'searchable_metadata' => $item[4],
                'exact_matching_metadata' => $item[5],
                'suggest' => $item[6],
            ];

            if (!empty($item[7])) {
                $itemAsArray['coordinate'] = $item[7];
            }

            return Item::createFromArray($itemAsArray);
        }, json_decode($data, true));
    }
564230
private function convertObjectToArray($data)
    {
        $converted = [];
        foreach($data as $key => $value) {
            if(is_object($value)) {
                $converted[$key] = $this->convertObjectToArray($value);
            } else {
                $converted[$key] = $value;
            }
        }

        return $converted;
    }
667757
public function deserialize($data)
    {
        $result = json_decode($data, true);
        if ($result === null) {
            return $data;
        }
        return $result;
    }
1153369
private function deserialize($data)
    {
        $result = json_decode(base64_decode($data, true), true);

        return is_array($result) ? $result : [];
    }
1210696
protected function unserialize(string $data)
    {
        $unserializedData = json_decode($data, true);
        $unserializedData['d'] = unserialize($unserializedData['d']);

        return $unserializedData;
    }
560395
protected function asArray($data)
  {
    $array = [];
    
    foreach(get_object_vars((object)$data) as $k => $v){
      if ( is_object($v) ){
        $array[$k] = $this->asArray($v);
      }
      else {
        $array[$k] = $v;
      }
    }
    
    return $array;
  }