<?php

namespace AutoAdmin\Bundle\Doctrine\Helper;

class ArrayToJsonHelper
{
    static public function convertArrayToJson(string $string): string
    {
        $unserializedString = unserialize($string);
        $jsonStringValue = json_encode($unserializedString, JSON_UNESCAPED_UNICODE);

        return $jsonStringValue;
    }

    static public function convertJsonToArray(string $string): string
    {
        $unserializedString = json_decode($string, true);
        $serializedString = serialize($unserializedString);

        return $serializedString;
    }
}
