<commit_before><?php

/*
|--------------------------------------------------------------------------
| Integrating Sentry Logging
|--------------------------------------------------------------------------
|
*/

/**
 * @file
 * Custom system helpers
 *
 * All DecimaERP code is copyright by the original authors and released under the GNU Aferro General Public License version 3 (AGPLv3) or later.
 * See COPYRIGHT and LICENSE.
 */

 if ( ! function_exists('eloquent_array_filter'))
 {
   /**
    * Removes empty string and null elements from an array
    *
    * @param  array  $array
    *
    * @return array
    */
   function eloquent_array_filter_for_insert($array)
   {
     return array_filter($array, function($a)
            {
                if(is_null($a))
                {
                  return false;
                }
                elseif (is_string($a) && trim($a) === "")
                // elseif (is_string($a) && (trim($a) === '' || trim($a) == ''  || trim($a) == ' ' || trim($a) == ' '))
                {
                  return false;
                }
                else
                {
                  return true;
                }
            });
   }
}

if ( ! function_exists('eloquent_array_filter'))
{
   /**
    * Removes null elements and converts empty string to null values from an array
    *
    * @param  array  $array
    *
    * @return array
    */
   function eloquent_array_filter_for_update($array)
   {
     return array_filter($array, function(&$a)
            {
                if(is_null($a))
                {
                  return false;
                }
                elseif (is_string($a) && (trim($a) === '' || trim($a) == ''  || trim($a) == ' ' || trim($a) == ' ' || trim($a) == '\xC2\xA0'))
                {
                  // return false;
                  $a = null;
                  return true;
                }
                else
                {
                  return true;
                }
            });
   }
 }

 if ( ! function_exists('remove_thousands_separator'))
 {
    /**
     * Remove thousands separator
     *
     * @param  string  $value
     *
     * @return string
     */
    function remove_thousands_separator($value)
    {
      return str_replace(Lang::get('form.thousandsSeparator'), '', $value);
    }
  }

  if ( ! function_exists('parse_jqgrid_filters'))<commit_msg>Issue #1<commit_after><?php

/*
|--------------------------------------------------------------------------
| Integrating Sentry Logging
|--------------------------------------------------------------------------
|
*/

/**
 * @file
 * Custom system helpers
 *
 * All DecimaERP code is copyright by the original authors and released under the GNU Aferro General Public License version 3 (AGPLv3) or later.
 * See COPYRIGHT and LICENSE.
 */

 if ( ! function_exists('eloquent_array_filter'))
 {
   /**
    * Removes empty string and null elements from an array
    *
    * @param  array  $array
    *
    * @return array
    */
   function eloquent_array_filter_for_insert($array)
   {
     return array_filter($array, function($a)
            {
                if(is_null($a))
                {
                  return false;
                }
                elseif (is_string($a) && trim($a) === "")
                // elseif (is_string($a) && (trim($a) === '' || trim($a) == ''  || trim($a) == ' ' || trim($a) == ' '))
                {
                  return false;
                }
                else
                {
                  return true;
                }
            });
   }
}

if ( ! function_exists('eloquent_array_filter'))
{
   /**
    * Removes null elements and converts empty string to null values from an array
    *
    * @param  array  $array
    *
    * @return array
    */
   function eloquent_array_filter_for_update($array)
   {
     return array_filter($array, function(&$a)
            {
                if(is_null($a))
                {
                  return false;
                }
                elseif (is_string($a) && (empty($a) || trim($a) === '' || trim($a) == ''  || trim($a) == ' ' || trim($a) == ' ' || trim($a) == '\xC2\xA0'))
                {
                  // return false;
                  $a = null;
                  return true;
                }
                else
                {
                  return true;
                }
            });
   }
 }

 if ( ! function_exists('remove_thousands_separator'))
 {
    /**
     * Remove thousands separator
     *
     * @param  string  $value
     *
     * @return string
     */
    function remove_thousands_separator($value)
    {
      return str_replace(Lang::get('form.thousandsSeparator'), '', $value);
    }
  }

  if ( ! function_exists('parse_jqgrid_filters'))
{'fraction_non_alphanumeric': 0.18961908748430306, 'fraction_numerical': 0.0018836333193804938, 'mean_word_length': 1.235266604303087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '197405', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1277, 'n_words': 271}