<commit_before><?php defined('SYSPATH') or die('No direct script access.');
/**
 * Sprig digit (integer) field.
 *
 * @package    Sprig
 * @author     <NAME>
 * @copyright  (c) 2009 <NAME>
 * @license    MIT
 */
class Sprig_Field_Integer extends Sprig_Field {

	public $default = 0;

	public $min_value;

	public $max_value;

	public function value($value)
	{
		if (empty($value) AND $this->empty)
		{
			$value = NULL;
		}
		else
		{
			$value = (int) $value;
		}

		return $value;
	}

} // End Sprig_Field_Integer<commit_msg>The default value of an integer field should not be 0, but NULL, like all other fields<commit_after><?php defined('SYSPATH') or die('No direct script access.');
/**
 * Sprig digit (integer) field.
 *
 * @package    Sprig
 * @author     <NAME>
 * @copyright  (c) 2009 <NAME>
 * @license    MIT
 */
class Sprig_Field_Integer extends Sprig_Field {

	public $min_value;

	public $max_value;

	public function value($value)
	{
		if ( ! empty($value))
		{
			$value = (int) $value;
		}

		return parent::value($value);
	}

} // End Sprig_Field_Integer
{'fraction_non_alphanumeric': 0.1417910447761194, 'fraction_numerical': 0.009328358208955223, 'mean_word_length': 3.379591836734694, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, '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': '6414772', 'n_tokens_mistral': 405, 'n_tokens_neox': 372, 'n_words': 105}