<commit_before><?php

namespace org\octris\core\validate {
    /****c* validate/type
     * NAME
     *      type
     * FUNCTION
     *      base class for all validation types
     * COPYRIGHT
     *      copyright (c) 2010 by <NAME>
     * AUTHOR
     *      <NAME> <<EMAIL>>
     ****
     */

    abstract class type {
        /****v* type/$options
         * SYNOPSIS
         */
        protected $options = array();
        /*
         * FUNCTION
         *      stores validation options
         ****
         */
    
        /****v* type/$pattern
         * SYNOPSIS
         */
        protected $pattern = '';
        /*
         * FUNCTION
         *      Validation pattern -- regular expression. If this is an
         *      empty string, the validation can only be performed server-
         *      side.
         ****
         */
        
        /****m* type/__construct
         * SYNOPSIS
         */
        public function __construct(array $options = array())
        /*
         * FUNCTION
         *      constructor
         * INPUTS
         *      * $options (array) -- optional options
         ****
         */
        {
            $this->options = $options;
        }
    
        /****m* type/validate
         * SYNOPSIS
         */
        abstract public function validate($value);
        /*
         * FUNCTION
         *      abstract methods must be implemented by subclasses
         ****
         */
    
        /****m* type/preFilter
         * SYNOPSIS
         */
        public function preFilter($value)
        /*
         * FUNCTION
         *      pre filter values
         * INPUTS
         *      * $value (mixed) -- value to filter
         * OUTPUTS
         *      (mixed) -- filtered value
         ****
         */
        {
            // strip magic quotes, if enabled
            if (get_magic_quotes_gpc()) {
                $value = stripslashes($value);
            }

            // replace nullbytes
            $value = str_replace("\0", '', $value);
        
            return $value;
        }
    
        /****m* type/postValidate
         * SYNOPSIS
         */
        public function postValidate($value)
        /*
         * FUNCTION
         *      
         * INPUTS
         *      
         * OUTPUTS
         *      
         ****
         */
        {
            return $value;
        }
    
        /****m* type/getOptions
         * SYNOPSIS
         */
        public function getOptions()
        /*
         * FUNCTION
         *      return the options, that where provided when constructing the object
         ****
         */
        {
            return $this->options;
        }
    
        /****m* type/getPattern
         * SYNOPSIS
         */
        public function getPattern()
        /*
         * FUNCTION
         *      returns a validation pattern.
         ****
         */
        {
            return $this->pattern;
        }
    }
}<commit_msg>- removed obsolete stuff<commit_after><?php

namespace org\octris\core\validate {
    /****c* validate/type
     * NAME
     *      type
     * FUNCTION
     *      base class for all validation types
     * COPYRIGHT
     *      copyright (c) 2010 by <NAME>
     * AUTHOR
     *      <NAME> <<EMAIL>>
     ****
     */

    abstract class type {
        /****v* type/$options
         * SYNOPSIS
         */
        protected $options = array();
        /*
         * FUNCTION
         *      stores validation options
         ****
         */
        
        /****m* type/__construct
         * SYNOPSIS
         */
        public function __construct(array $options = array())
        /*
         * FUNCTION
         *      constructor
         * INPUTS
         *      * $options (array) -- optional options
         ****
         */
        {
            $this->options = $options;
        }
    
        /****m* type/validate
         * SYNOPSIS
         */
        abstract public function validate($value);
        /*
         * FUNCTION
         *      abstract methods must be implemented by subclasses
         ****
         */
    
        /****m* type/preFilter
         * SYNOPSIS
         */
        public function preFilter($value)
        /*
         * FUNCTION
         *      pre filter values
         * INPUTS
         *      * $value (mixed) -- value to filter
         * OUTPUTS
         *      (mixed) -- filtered value
         ****
         */
        {
            // strip magic quotes, if enabled
            if (get_magic_quotes_gpc()) {
                $value = stripslashes($value);
            }

            // replace nullbytes
            $value = str_replace("\0", '', $value);
        
            return $value;
        }
    
        /****m* type/getOptions
         * SYNOPSIS
         */
        public function getOptions()
        /*
         * FUNCTION
         *      return the options, that where provided when constructing the object
         ****
         */
        {
            return $this->options;
        }
    }
}
{'fraction_non_alphanumeric': 0.11221449851042702, 'fraction_numerical': 0.0019860973187686196, 'mean_word_length': 1.0031821797931584, 'pattern_counts': {'":': 0, '<': 13, '<?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': '1526706', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1289, 'n_words': 297}