<commit_before><?php

// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

/**
 * Papi Property Repeater.
 *
 * @package Papi
 * @since 1.0.0
 */

class Papi_Property_Repeater extends Papi_Property {

	/**
	 * Repeater counter number.
	 *
	 * @var int
	 * @since 1.0.0
	 */

	protected $counter = 0;

	/**
	 * The default value.
	 *
	 * @var array
	 * @since 1.0.0
	 */

	public $default_value = array();

	/**
	 * Format the value of the property before it's returned to the theme.
	 *
	 * @param mixed $values
	 * @param string $repeater_slug
	 * @param int $post_id
	 * @since 1.0.0
	 *
	 * @return array
	 */

	public function format_value( $values, $repeater_slug, $post_id ) {
		if ( ! is_array( $values ) ) {
			return array();
		}

		$values = papi_to_property_array_slugs( $values, $repeater_slug );

		foreach ( $values as $slug => $value ) {
			if ( papi_is_property_type_key( $slug ) ) {
				continue;
			}

			$property_type_slug = papi_f( papi_get_property_type_key( $slug ) );

			if ( ! isset( $values[$property_type_slug] ) ) {
				continue;
			}

			// Get property type
			$property_type_value = $values[$property_type_slug];
			$property_type = papi_get_property_type( $property_type_value );

			// Run update value on each property type class.
			$value = $property_type->format_value( $value, $slug, $post_id );

			$values[$property_type_slug] = $property_type_value;
		}

		if ( ! is_admin() ) {
			foreach ( $values as $slug => $value ) {
				if ( papi_is_property_type_key( $slug ) ) {
					unset( $values[$slug] );
				}
			}
		}

		return papi_from_property_array_slugs( $values, $repeater_slug );<commit_msg>Fixed so formatted value is set right<commit_after><?php

// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

/**
 * Papi Property Repeater.
 *
 * @package Papi
 * @since 1.0.0
 */

class Papi_Property_Repeater extends Papi_Property {

	/**
	 * Repeater counter number.
	 *
	 * @var int
	 * @since 1.0.0
	 */

	protected $counter = 0;

	/**
	 * The default value.
	 *
	 * @var array
	 * @since 1.0.0
	 */

	public $default_value = array();

	/**
	 * Format the value of the property before it's returned to the theme.
	 *
	 * @param mixed $values
	 * @param string $repeater_slug
	 * @param int $post_id
	 * @since 1.0.0
	 *
	 * @return array
	 */

	public function format_value( $values, $repeater_slug, $post_id ) {
		if ( ! is_array( $values ) ) {
			return array();
		}

		$values = papi_to_property_array_slugs( $values, $repeater_slug );

		foreach ( $values as $slug => $value ) {
			if ( papi_is_property_type_key( $slug ) ) {
				continue;
			}

			$property_type_slug = papi_f( papi_get_property_type_key( $slug ) );

			if ( ! isset( $values[$property_type_slug] ) ) {
				continue;
			}

			// Get property type
			$property_type_value = $values[$property_type_slug];
			$property_type = papi_get_property_type( $property_type_value );

			// Run update value on each property type class.
			$values[$slug] = $property_type->format_value( $value, $slug, $post_id );

			$values[$property_type_slug] = $property_type_value;
		}

		if ( ! is_admin() ) {
			foreach ( $values as $slug => $value ) {
				if ( papi_is_property_type_key( $slug ) ) {
					unset( $values[$slug] );
				}
			}
		}

		return papi_from_property_array_slugs( $values, $repeater_slug );
{'fraction_non_alphanumeric': 0.1381697772426249, 'fraction_numerical': 0.007826610475617099, 'mean_word_length': 3.1589486858573217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6537775', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1206, 'n_words': 276}