<commit_before><?php

namespace mako
{
	/**
	* Class for filtering and validating input.
	*
	* @author     <NAME>
	* @copyright  (c) 2008-2011 <NAME>
	* @license    http://www.makoframework.com/license
	*/

	class Input
	{
		//---------------------------------------------
		// Class variables
		//---------------------------------------------

		/**
		* Holds the input array.
		*/

		protected $input;

		/**
		* Holds the returned errors.
		*/

		protected $errors = array();
		
		/**
		* Holds all the callback filtering functions that need to be run.
		*/
		
		protected $filters = array();

		/**
		* Holds all the callback validation functions that need to be run.
		*/

		protected $rules = array();

		//---------------------------------------------
		// Class constructor, destructor etc ...
		//---------------------------------------------

		/**
		* Class constructor.
		*
		* @access  public
		* @param   array  Array to validate
		*/

		public function __construct(array & $input)
		{
			$this->input = & $input;
		}

		/**
		* Factory method making method chaining possible right off the bat.
		*
		* @access  public
		* @param   array     Array to validate
		* @return  Validate
		*/

		public static function factory(array $input)
		{
			return new static($input);
		}

		//---------------------------------------------
		// Class methods
		//---------------------------------------------
		
		/**
		* Adds a filter to the list of callbacks.
		*
		* @access  public
		* @param   mixed     Field name - if set to TRUE then the filter will be run on all fields
		* @param   callback  Filter function<commit_msg>Fixed bug in input class<commit_after><?php

namespace mako
{
	/**
	* Class for filtering and validating input.
	*
	* @author     <NAME>
	* @copyright  (c) 2008-2011 Freder<NAME>
	* @license    http://www.makoframework.com/license
	*/

	class Input
	{
		//---------------------------------------------
		// Class variables
		//---------------------------------------------

		/**
		* Holds the input array.
		*/

		protected $input;

		/**
		* Holds the returned errors.
		*/

		protected $errors = array();
		
		/**
		* Holds all the callback filtering functions that need to be run.
		*/
		
		protected $filters = array();

		/**
		* Holds all the callback validation functions that need to be run.
		*/

		protected $rules = array();

		//---------------------------------------------
		// Class constructor, destructor etc ...
		//---------------------------------------------

		/**
		* Class constructor.
		*
		* @access  public
		* @param   array  Array to validate
		*/

		public function __construct(array & $input)
		{
			$this->input = & $input;
		}

		/**
		* Factory method making method chaining possible right off the bat.
		*
		* @access  public
		* @param   array     Array to validate
		* @return  Validate
		*/

		public static function factory(array & $input)
		{
			return new static($input);
		}

		//---------------------------------------------
		// Class methods
		//---------------------------------------------
		
		/**
		* Adds a filter to the list of callbacks.
		*
		* @access  public
		* @param   mixed     Field name - if set to TRUE then the filter will be run on all fields
		* @param   callback  Filter function
{'fraction_non_alphanumeric': 0.2642835319278949, 'fraction_numerical': 0.00488848151542927, 'mean_word_length': 1.3587896253602305, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '335488', 'n_tokens_mistral': 1035, 'n_tokens_neox': 868, 'n_words': 285}