<commit_before> <?php
namespace shankarbala33\php-validation\model;


/**
 * Class Validator
 * @package StorePress\Helper
 */
class Validator
{
 
 /**
     * To Validates the input with the given rules
     *
     * @param object $http of post data
     * @param array $rules set of to check with the data
     * @return array of result of validation
     */
    public static function validate($http, $rules)
    {
        $error = array();
        foreach ($rules as $key => $rule) {
            if ($rule == 'Required') {
                if (!$http->has($key)) {
                    $error[$key] = $rule;
                }
            }
        }
        return $error;
    }
<commit_msg>Update Validator.php<commit_after> <?php
namespace shankarbala33\php-validation\model;


/**
 * Class Validator
 * @package StorePress\Helper
 */
class Validator
{
 
 /**
     * To Validates the input with the given rules
     *
     * @param object $http of post data
     * @param array $rules set of to check with the data
     * @return array of result of validation
     */
    public static function validate($http, $rules)
    {
        $error = array();
        foreach ($rules as $key => $rule) {
            if ($rule == 'Required') {
                if (!isset($http[$key]) {
                    $error[$key] = $rule;
                }
            }
        }
        return $error;
    }

{'fraction_non_alphanumeric': 0.1206896551724138, 'fraction_numerical': 0.0028735632183908046, 'mean_word_length': 1.7529644268774704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '4085631', 'n_tokens_mistral': 399, 'n_tokens_neox': 385, 'n_words': 123}