<commit_before><?php

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

/**
 * Papi Property class.
 *
 * @package Papi
 */
class Papi_Property extends Papi_Core_Property {

	/**
	 * Get default options.
	 *
	 * @TODO check if this can be removed,
	 * papi ajax is using it.
	 *
	 * @return array
	 */
	public static function default_options() {
		$property = new static;
		$default_options = $property->default_options;

		if ( $default_options['sort_order'] === -1 ) {
			$default_options['sort_order'] = papi_filter_settings_sort_order();
		}

		return $default_options;
	}

	/**
	 * Render property html.
	 */
	public function html() {
	}

	/**
	 * Get the html id attribute value.
	 *
	 * @param  object|string $suffix
	 * @param  int $row
	 *
	 * @return string
	 */
	public function html_id( $suffix = '', $row = null ) {
		if ( is_array( $suffix ) || is_object( $suffix ) ) {
			return '_' . $this->html_name( $suffix, $row );
		} else {
			$suffix = empty( $suffix ) ||
				! is_string( $suffix ) ? '' : '_' . $suffix;
			$suffix = papi_underscorify( papi_slugify( $suffix ) );
		}

		return sprintf( '_%s%s', $this->html_name(), $suffix );
	}

	/**
	 * Get html name for property with or without sub property and row number.
	 *
	 * @param  array|object $sub_property
	 * @param  int $row
	 *
	 * @return string
	 */
	public function html_name( $sub_property = null, $row = null ) {
		$base_slug = $this->get_option( 'slug' );
<commit_msg>Add support for moving last ] when adding extra suffix<commit_after><?php

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

/**
 * Papi Property class.
 *
 * @package Papi
 */
class Papi_Property extends Papi_Core_Property {

	/**
	 * Get default options.
	 *
	 * @TODO check if this can be removed,
	 * papi ajax is using it.
	 *
	 * @return array
	 */
	public static function default_options() {
		$property = new static;
		$default_options = $property->default_options;

		if ( $default_options['sort_order'] === -1 ) {
			$default_options['sort_order'] = papi_filter_settings_sort_order();
		}

		return $default_options;
	}

	/**
	 * Render property html.
	 */
	public function html() {
	}

	/**
	 * Get the html id attribute value.
	 *
	 * @param  object|string $suffix
	 * @param  int $row
	 *
	 * @return string
	 */
	public function html_id( $suffix = '', $row = null ) {
		if ( is_array( $suffix ) || is_object( $suffix ) ) {
			return '_' . $this->html_name( $suffix, $row );
		} else {
			$suffix = empty( $suffix ) ||
				! is_string( $suffix ) ? '' : '_' . $suffix;
			$suffix = papi_underscorify( papi_slugify( $suffix ) );
		}

		$name = $this->html_name();

		if ( $name[strlen( $name )-1] === ']' ) {
			return sprintf( '_%s%s]', substr( $name, 0, strlen( $name )-1 ), $suffix );
		}

		return sprintf( '_%s%s', $this->html_name(), $suffix );
	}

	/**
	 * Get html name for property with or without sub property and row number.
	 *
	 * @param  array|object $sub_property
	 * @param  int $row
	 *
	 * @return string
	 */
	public function html_name( $sub_property = null, $row = null ) {
		$base_slug = $this->get_option( 'slug' );

{'fraction_non_alphanumeric': 0.15779345734445158, 'fraction_numerical': 0.001603592046183451, 'mean_word_length': 3.1311258278145697, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '6808142', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1057, 'n_words': 288}