public static function cloneArray(array $array): array
    {
        $newArray = [];
        foreach($array as $key => $value) {
            if(\is_object($value)) {
                $newArray[$key] = clone $value;
            } elseif(\is_array($value)) {
                $newArray[$key] = self::cloneArray($value);
            } else {
                $newArray[$key] = $value;
            }
        }
        return $newArray;
    }