<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  /**
   * Handler
   *
   * @see      xp://org.apache.xml.workflow.State#addHandler
   * @purpose  Abstract base class
   */
  class Handler extends Object {
    var
      $form     = '',
      $errors   = array();
    
    /**
     * Constructor
     *
     * @access  public
     * @param   string form
     */
    function __construct($form) {
      $this->form= $form;
      parent::__construct();
    }
     
    /**
     * Add an error
     *
     * @access  public
     * @param   string statuscode
     * @return  bool FALSE
     */  
    function addError($statuscode) {
      $this->errors[]= $statuscode;
      return FALSE;
    }
    
    /**
     * Handle submitted data
     *
     * @access  public
     * @param   &org.apache.xml.workflow.Context context
     * @param   &org.apache.xml.HttpScriptletRequest request<commit_msg>- Add member variable wrappers and accessors<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  /**
   * Handler
   *
   * @see      xp://org.apache.xml.workflow.State#addHandler
   * @purpose  Abstract base class
   */
  class Handler extends Object {
    var
      $form     = '',
      $errors   = array(),
      $wrappers = array();
    
    /**
     * Constructor
     *
     * @access  public
     * @param   string form
     */
    function __construct($form) {
      $this->form= $form;
      parent::__construct();
    }
    
    /**
     * Set a wrapper for a field
     *
     * @access  public
     * @param   string field
     * @param   &org.apache.xml.workflow.Wrapper wrapper  
     */
    function setWrapper($field, &$wrapper) {
      $this->wrappers[$field]= &$wrapper;
    }
    
    /**
     * Get a wrapper for a field
     *
     * @access  public
     * @param   string field
     * @return  &org.apache.xml.workflow.Wrapper wrapper, if existant or NULL
     */
    function getWrapper($field) {
      return isset($this->wrappers[$field]) ? $this->wrappers[$field] : NULL;
    }

    /**
     * Check whether a wrapper exists for a given field
     *
     * @access  public
     * @param   string field
     * @return  bool
     */
    function hasWrapper($field) {
      return isset($this->wrappers[$field]);
    }
    
    /**
     * Add an error
     *
     * @access  public
     * @param   string statuscode
     * @return  bool FALSE
     */  
    function addError($statuscode) {
      $this->errors[]= $statuscode;
      return FALSE;
    }
    
    /**
     * Handle submitted data
     *
     * @access  public
     * @param   &org.apache.xml.workflow.Context context
     * @param   &org.apache.xml.HttpScriptletRequest request
{'fraction_non_alphanumeric': 0.12661023187338977, 'fraction_numerical': 0.0, 'mean_word_length': 1.7962962962962963, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '2396788', 'n_tokens_mistral': 848, 'n_tokens_neox': 838, 'n_words': 198}