<commit_before><?php //-->

namespace Modules;

/**
 * General available methods
 *
 * @category   utility
 * @author     javincX
 */

class Helper
{
    /* Constants
    --------------------------------------------*/
    /* Public Properties
    --------------------------------------------*/
    /* Protected Properties
    --------------------------------------------*/
    /* Public Methods
    --------------------------------------------*/
    /*
     * get POST JSON data
     *
     * @param int index
     * @return array 
     */
    public static function getJson($field = null)
    {
        if($input = (array) json_decode(file_get_contents('php://input'))) {
            control()->registry()->set('input', $input);
        }

        $data = self::getData((array)control()->registry()['input'], $field);

        // check if invalid json<commit_msg>add service util & chnage definition of Helper Module<commit_after><?php //-->

namespace Modules;

/**
 * Utility for Structure
 *
 * @category   utility
 * @author     javincX
 */

class Helper
{
    /* Constants
    --------------------------------------------*/
    /* Public Properties
    --------------------------------------------*/
    /* Protected Properties
    --------------------------------------------*/
    /* Public Methods
    --------------------------------------------*/
    /*
     * get POST JSON data
     *
     * @param int index
     * @return array 
     */
    public static function getJson($field = null)
    {
        if($input = (array) json_decode(file_get_contents('php://input'))) {
            control()->registry()->set('input', $input);
        }

        $data = self::getData((array)control()->registry()['input'], $field);

        // check if invalid json
{'fraction_non_alphanumeric': 0.32369614512471656, 'fraction_numerical': 0.0, 'mean_word_length': 1.170971709717097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2191313', 'n_tokens_mistral': 425, 'n_tokens_neox': 417, 'n_words': 96}