<commit_before><?php defined( 'ABSPATH' ) or die();

/**
 * WFV_Form
 * Configures a unique form
 * Captures $_POST data if action value matches config
 *
 * @since 0.1.0
 * @since 0.6.0 Renamed from Form_Validation
 */
// class Form_Validation {
class WFV_Form extends WFV_Validate {

  /**
   * Class constructor
   *
   * @since 0.1.0
   * @since 0.4.0 Reduced to single parameter
   * @param array $form Form configuration (rules, action)
   *
   */
  function __construct( $form ) {
    $this->set( $form );
  }

  /**
   * Return property value
   *
   * @since 0.6.1
   * @param string $property Property key name
   *
   * @return string|array Property value
   */
  public function get( $property ) {
    return ( true === property_exists( $this, $property ) ) ? $this->$property : null;
  }

  /**
   * Convienience method to access rules property
   *
   * @since 0.7.2
   * @param string (optional) $field The field name
   *
   * @return
   */
  public function rules( $field = null ) {
    return ( $field ) ? $this->rules->get( $field ) : $this->rules;
  }

  /**
   * Return field value from $input property
   *
   * @since 0.6.1
   * @param string $field Name of field
   *
   * @return string Field value
   */
  public function get_input( $field ) {
    return $this->input[ $field ];
  }

  /**
   * Return fields $error property
   * By default returns all errors
   * If $field_name is supplied a string, only error for the field
   * $bag is array of messages, false returns first error as string
   *
   * @since 0.6.1
   * @param string (optional) $field_name Only errors for $field_name
   * @param bool (optional) $bag true return array error bag for field
   *
   * @return string|array String if $field is string and $bag = false, array otherwise
   */
  public function get_error( $field_name = null, $bag = false ) {
    if( $field_name ) {
      return ( true == $bag ) ? $this->errors[ $field_name ] : $this->errors[ $field_name ][0];<commit_msg>convienience method to access input property<commit_after><?php defined( 'ABSPATH' ) or die();

/**
 * WFV_Form
 * Configures a unique form
 * Captures $_POST data if action value matches config
 *
 * @since 0.1.0
 * @since 0.6.0 Renamed from Form_Validation
 */
// class Form_Validation {
class WFV_Form extends WFV_Validate {

  /**
   * Class constructor
   *
   * @since 0.1.0
   * @since 0.4.0 Reduced to single parameter
   * @param array $form Form configuration (rules, action)
   *
   */
  function __construct( $form ) {
    $this->set( $form );
  }

  /**
   * Return property value
   *
   * @since 0.6.1
   * @param string $property Property key name
   *
   * @return string|array Property value
   */
  public function get( $property ) {
    return ( true === property_exists( $this, $property ) ) ? $this->$property : null;
  }

  /**
   * Convienience method to access rules property
   *
   * @since 0.7.2
   * @param string (optional) $field The field name
   *
   * @return
   */
  public function rules( $field = null ) {
    return ( $field ) ? $this->rules->get( $field ) : $this->rules;
  }

  /**
   * Return field value from $input property
   *
   * @since 0.6.1
   * @param string $field Name of field
   *
   * @return string Field value
   */
  public function input( $field ) {
    return $this->input->get( $field );
  }

  /**
   * Return fields $error property
   * By default returns all errors
   * If $field_name is supplied a string, only error for the field
   * $bag is array of messages, false returns first error as string
   *
   * @since 0.6.1
   * @param string (optional) $field_name Only errors for $field_name
   * @param bool (optional) $bag true return array error bag for field
   *
   * @return string|array String if $field is string and $bag = false, array otherwise
   */
  public function get_error( $field_name = null, $bag = false ) {
    if( $field_name ) {
      return ( true == $bag ) ? $this->errors[ $field_name ] : $this->errors[ $field_name ][0];
{'fraction_non_alphanumeric': 0.12675350701402804, 'fraction_numerical': 0.012525050100200401, 'mean_word_length': 2.763430725730443, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '66186', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1267, 'n_words': 426}