Deserialize all data recursively

@param  array|object $data data array or object
@return array|object       data passed in with deserialized values
330207
protected function deserializeDataRecursive($data)
	{
		foreach ($data as $key => $value) {
			if (is_string($value) && trim($value)) {
				if (is_object($data)) {
					$data->$key = \StringUtil::deserialize($value);
				}
				else {
					$data[$key] = \StringUtil::deserialize($value);
				}
			}
			else if (is_array($value) || is_object($value)) {
				if (is_object($data)) {
					$data->$key = $this->deserializeDataRecursive($value);
				}
				else {
					$data[$key] = $this->deserializeDataRecursive($value);
				}
			}
		}

		return $data;
	}
1374487
protected function fromArray($data)
    {
        if (empty($data)) {
            return $this;
        }

        $this->data = array_replace_recursive($this->data, $data);

        return $this;
    }
593848
public static function normalizeArray($data)
    {
        if ($data instanceof DataObjectInterface) {
            $data = $data->getData();
        } else if ($data instanceof \ArrayObject) {
            $data = $data->getArrayCopy();
        } else if ($data instanceof \Traversable) {
            $data = iterator_to_array($data);
        }

        if (!is_array($data)) throw new \InvalidArgumentException();

        return $data;
    }
553740
public function serialize($data)
    {
        if (is_string($data) === true) {
            return $data;
        } else {
            $data = json_encode($data);
            if ($data === '[]') {
                return '{}';
            } else {
                return $data;
            }
        }


    }
83270
protected function decodeData($data): array
    {
        if (!\is_array($data)) {
            return [];
        }

        // Decode JSON encoded fields and merge them to data.
        if (isset($data['_json'])) {
            $data = array_replace_recursive($data, $this->jsonDecode($data['_json']));
            unset($data['_json']);
        }

        return $data;
    }
1253064
public static function deserializeObject(array $data)
    {
        /** @var ServiceProviderConfig $result */
        $result = self::deserializeCommonAttributes($data);

        if (isset($data['documentationUri'])) {
            $result->documentationUri = $data['documentationUri'];
        }
        $result->patch = SPC\Patch::deserializeObject($data['patch']);
        $result->bulk = SPC\Bulk::deserializeObject($data['bulk']);
        $result->filter = SPC\Filter::deserializeObject($data['filter']);
        $result->eTag = SPC\ETag::deserializeObject($data['etag']);
        $result->changePassword = SPC\ChangePassword::deserializeObject($data['changePassword']);
        $result->sort = SPC\Sort::deserializeObject($data['sort']);

        if (isset($data['authenticationSchemes'])) {
            foreach ($data['authenticationSchemes'] as $authenticationScheme) {
                $result->authenticationSchemes[] = SPC\AuthenticationScheme::deserializeObject($authenticationScheme);
            }
        }

        return $result;
    }
1236522
final protected function sanitize($data)
    {
        // Recursively loop through the data array and return the sanitized data
        $sanitized = [];
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                $sanitized[$key] = $this->sanitize($value);
            }
        } else {
            $sanitized = trim(strip_tags($data));
        }
        return $sanitized;
    }
921957
protected function unformatPayloadData(array $data)
    {
        $unformattedData = array();

        foreach ($data as $key => $value) {
            $newKey = $this->deserializeColumnName($key);

            if (is_array($value)) {
                $newValue = $this->unformatPayloadData($value);
            } else {
                $newValue = $value;
            }

            $unformattedData[$newKey] = $newValue;
        }

        return $unformattedData;
    }
1349629
public function to_serialized($data = null)
	{
		if ($data === null)
		{
			$data = $this->_data;
		}

		return serialize($data);
	}
144025
public function unredislize($data)
    {
        $data = urldecode($data);

        if (self::isSerialized($data)) {
            $unserializedData = @unserialize($data);
            if ($unserializedData !== false) {
                return $unserializedData;
            }
        }

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

        return $unserializedData;
    }
234781
public static function deserializeObject(array $data)
    {
        $result = new static($data['resourceType'], isset($data['created']) ? Helper::string2dateTime($data['created']) : null);
        if (isset($data['lastModified'])) {
            $result->lastModified = Helper::string2dateTime($data['lastModified']);
        }
        if (isset($data['location'])) {
            $result->location = $data['location'];
        }
        if (isset($data['version'])) {
            $result->version = $data['version'];
        }

        return $result;
    }
930410
public function unserialize($data)
    {
        $object = @unserialize($data);
        if($object === false) {
            throw new SerializerException("Unable to unserialize data: " . $data);
        }

        return $object;
    }
1125366
public static function fromData(array $data)
    {
        $reflection = new \ReflectionClass(static::class);
        $instance = $reflection->newInstanceWithoutConstructor();
        $instance->data = $data;
        $instance->jsonUnserialize($data);
        return $instance;
    }
122619
private function unserializeArray(array $data)
    {
        $unserialized = [];

        foreach ($data as $key => $value) {
            if ($value instanceof ObjectStub) {
                $unserialized[$key] = $value->getObject();

                continue;
            }

            $unserialized[$key] = is_array($value) ? $this->unserializeArray($value) : $value;
        }

        return $unserialized;
    }
1239851
public function arraySerialize(array $Data)
    {
        $Result = "";
        foreach ($Data as $Value) {
            if ($Result == "") {
                $Result = floor($Value);
            } else {
                $Result = $Result . "," . floor($Value);
            }
        }

        return $Result;
    }
218252
protected function recursiveConvertArray($data)
    {
        $out = [];

        foreach ($data as $key => $value) {
            $nkey = $this->normalize($key);

            if (in_array($nkey, $this->ignoredAttributes)) {
                continue;
            }

            $out[$nkey] = is_scalar($value) ? $value : $this->convertValue($value);
        }

        return $out;
    }