<commit_before><?php
/**
 * This DataObject defines a time zone entry in the database.
 */
class TimeZone extends DataObject {
	/**
	 * @var array
	 */
	private static $db = array(
		'Identifier' => 'varchar(255)',
		'Region' => 'varchar(255)',
		'Name' => 'varchar(255)',
		'Title' => 'varchar(255)',
	);

	/**
	 * Defines the format of the title, which is used e.g. for the dropdown.
	 *
	 * @var string
	 */
	public $format = '%Name';

	/**
	 * {@inheritdoc}
	 */
	public function requireDefaultRecords() {
		parent::requireDefaultRecords();

		// run the population task if required.
		if(PopulateTimeZonesTask::config()->run_during_dev_build) {
			$task = new PopulateTimeZonesTask();
			$task->up();
		}
	}

	/**
	 * Returns the title according to the configuration
	 *
	 * @return string
	 */
	protected function prepareTitle() {
		$title = $this->format;

		// replace the placeholders with actual data
		foreach (array_keys(self::$db) as $key) {
			$title = str_ireplace('%' . $key, $this->$key, $title);
		}

		return $title;
	}
}
<commit_msg>changing preparetitle to public to allow access from task<commit_after><?php
/**
 * This DataObject defines a time zone entry in the database.
 */
class TimeZone extends DataObject {
	/**
	 * @var array
	 */
	private static $db = array(
		'Identifier' => 'varchar(255)',
		'Region' => 'varchar(255)',
		'Name' => 'varchar(255)',
		'Title' => 'varchar(255)',
	);

	/**
	 * Defines the format of the title, which is used e.g. for the dropdown.
	 *
	 * @var string
	 */
	public $format = '%Name';

	/**
	 * {@inheritdoc}
	 */
	public function requireDefaultRecords() {
		parent::requireDefaultRecords();

		// run the population task if required.
		if(PopulateTimeZonesTask::config()->run_during_dev_build) {
			$task = new PopulateTimeZonesTask();
			$task->up();
		}
	}

	/**
	 * Returns the title according to the configuration
	 *
	 * @return string
	 */
	public function prepareTitle() {
		$title = $this->format;

		// replace the placeholders with actual data
		foreach (array_keys(self::$db) as $key) {
			$title = str_ireplace('%' . $key, $this->$key, $title);
		}

		return $title;
	}
}

{'fraction_non_alphanumeric': 0.16115510013972986, 'fraction_numerical': 0.011178388448998603, 'mean_word_length': 3.428865979381443, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '2725253', 'n_tokens_mistral': 782, 'n_tokens_neox': 699, 'n_words': 196}