<commit_before><?php namespace Devise\Pages\Fields;

/**
 * Field value is an object that holds json
 * values for a DvsField model
 *
 */
class FieldValue
{
	/**
	 * Json string
	 *
	 * @var string
	 */
	protected $json;

	/**
	 * Create a new FieldValue object from json string
	 *
	 * @param string $json
	 */
	public function __construct($json)
	{
		$this->json = $json;
		$values = json_decode($json);

		foreach ($values as $key => $value)
		{
			$this->$key = $value;<commit_msg>Added count property to collections to know how many values it had<commit_after><?php namespace Devise\Pages\Fields;

/**
 * Field value is an object that holds json
 * values for a DvsField model
 *
 */
class FieldValue
{
	/**
	 * Json string
	 *
	 * @var string
	 */
	protected $json;
	
	/**
	 * Number of values on this field value
	 *
	 * @var integer
	 */
	protected $count;

	/**
	 * Create a new FieldValue object from json string
	 *
	 * @param string $json
	 */
	public function __construct($json)
	{
		$this->json = $json;
		$values = json_decode($json, true);

		$this->count = count($values);

		foreach ($values as $key => $value)
		{
			$this->$key = $value;
{'fraction_non_alphanumeric': 0.13644214162348878, 'fraction_numerical': 0.0, 'mean_word_length': 3.0243055555555554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '3732704', 'n_tokens_mistral': 402, 'n_tokens_neox': 362, 'n_words': 122}