<commit_before><?php

/**
 * Adds additional validation rules to the Form_validation library
 *
 * @package     Nails
 * @subpackage  common
 * @category    Library
 * @author      Nails Dev Team
 * @link
 */

namespace Nails\Common\CodeIgniter\Libraries;

use CI_Form_validation;
use Nails\Common\Helper\ArrayHelper;
use Nails\Common\Service\Database;
use Nails\Common\Service\Input;
use Nails\Common\Service\Locale;
use Nails\Factory;

/**
 * Class FormValidation
 *
 * @package Nails\Common\CodeIgniter\Libraries
 */
class FormValidation extends CI_Form_validation
{
    /**
     * Quick mod of run() to allow for HMVC.
     *
     * @param string $module
     * @param string $group
     *
     * @return bool
     */
    public function run($module = '', $group = '')
    {
        if (is_object($module)) {
            $this->CI       = &$module;
            $this->CI->lang = &get_instance()->lang;
        }
        return parent::run($group);
    }

    // --------------------------------------------------------------------------

    /**
     * Returns the current ruleset
     *
     * @return array
     */
    public function getRules(): array
    {
        return array_combine(
            array_keys($this->_field_data),<commit_msg>Fix for CI FormValidation library<commit_after><?php

/**
 * Adds additional validation rules to the Form_validation library
 *
 * @package     Nails
 * @subpackage  common
 * @category    Library
 * @author      Nails Dev Team
 * @link
 */

namespace Nails\Common\CodeIgniter\Libraries;

use CI_Form_validation;
use Nails\Common\Helper\ArrayHelper;
use Nails\Common\Service\Database;
use Nails\Common\Service\Input;
use Nails\Common\Service\Locale;
use Nails\Factory;

/**
 * Class FormValidation
 *
 * @package Nails\Common\CodeIgniter\Libraries
 */
class FormValidation extends CI_Form_validation
{
    /**
     * Quick mod of run() to allow for HMVC.
     *
     * @param string $module
     * @param string $group
     *
     * @return bool
     */
    public function run($module = '', $group = '')
    {
        if (is_object($module)) {
            $this->CI        = &$module;
            $this->CI->input = &get_instance()->input;
            $this->CI->lang  = &get_instance()->lang;
        }
        return parent::run($group);
    }

    // --------------------------------------------------------------------------

    /**
     * Returns the current ruleset
     *
     * @return array
     */
    public function getRules(): array
    {
        return array_combine(
            array_keys($this->_field_data),
{'fraction_non_alphanumeric': 0.1738455568490493, 'fraction_numerical': 0.0, 'mean_word_length': 1.9530355097365406, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '6981660', 'n_tokens_mistral': 740, 'n_tokens_neox': 728, 'n_words': 171}