<commit_before><?php
// namespace WFV;
defined( 'ABSPATH' ) or die();
/*
Plugin Name: WFV - Form Validation
Plugin URI:  https://github.com/macder/wp-form-validation
Description: See README.md
Version:     0.9.1
Author:      <NAME>
Author URI:  https://derulski.com
License:     GPL3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/

define( 'WFV_VALIDATE_VERSION', '0.9.1' );
define( 'WFV_VALIDATE__MINIMUM_WP_VERSION', '3.7' );
define( 'WFV_VALIDATE__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'WFV_VALIDATE__ACTION_POST', 'validate_form' );

require_once WFV_VALIDATE__PLUGIN_DIR . '/vendor/autoload.php';

use WFV\Builder\ValidationBuilder;
use WFV\Builder\Director;

/**
 * Build instance of WFV\Validator using factory
 * Assign by reference the instance, as described by $form.
 *
 * @since 0.3.0
 * @since 0.5.0 $form parameter creates reference
 * @since 0.8.2 uses factory to create object
 *
 * @param array $form Form configuration
 */
function wfv_create( &$form ) {

  $validation_builder = new ValidationBuilder( $form );
  $form = ( new Director() )->build( $validation_builder );
}

/**
 *
 *
 *
 * @since 0.9.2
 *<commit_msg>wfv-validate - updated 'bootstrapping' logic<commit_after><?php
// namespace WFV;
defined( 'ABSPATH' ) or die();
/*
Plugin Name: WFV - Form Validation
Plugin URI:  https://github.com/macder/wp-form-validation
Description: See README.md
Version:     0.9.1
Author:      <NAME>
Author URI:  https://derulski.com
License:     GPL3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/

define( 'WFV_VALIDATE_VERSION', '0.9.1' );
define( 'WFV_VALIDATE__MINIMUM_WP_VERSION', '3.7' );
define( 'WFV_VALIDATE__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'WFV_VALIDATE__ACTION_POST', 'validate_form' );

require_once WFV_VALIDATE__PLUGIN_DIR . '/vendor/autoload.php';

use WFV\Builder\FormBuilder;
use WFV\Builder\Director;

/**
 * Build instance of WFV\Validator using factory
 * Assign by reference the instance, as described by $form.
 *
 * @since 0.3.0
 * @since 0.9.2
 *
 * @param array $form Form configuration
 */
function wfv_create( &$form ) {

  $action = $form['action'];
  $rules = $form['rules'];

  $builder = new FormBuilder( $action, $rules );
  $form = ( new Director() )->build( $builder );
}

/**
 *
 *
 *
 * @since 0.9.2
 *
{'fraction_non_alphanumeric': 0.15221162185602774, 'fraction_numerical': 0.0186470078057242, 'mean_word_length': 4.103982300884955, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '2799963', 'n_tokens_mistral': 860, 'n_tokens_neox': 827, 'n_words': 195}