<commit_before><?php
/**
 * Database migration class
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */

namespace Skeleton\Database;

use Skeleton\Database\Migration\Config;

class Migration {

	/**
	 * Get version
	 *
	 * @access public
	 * @return Datetime $version
	 */
	public function get_version() {
		$classname = get_class($this); // Migration_20150922_203123_Init
		list($migration, $date, $time, $name) = explode('_', $classname);
		return \Datetime::createFromFormat('YmdHis', $date . $time);
	}

	/**
	 * Run
	 *
	 $ @access public
	 * @param string up/down
	 */
	public function run($method) {
		$this->$method();
		file_put_contents(Config::$migration_directory . '/db_version', $this->get_version()->format('Ymd His'));
	}

	/**
	 * Get between versions
	 *
	 * @access public
	 * @param Datetime $start_date
	 * @param Datetime $end_date
	 * @return array $migrations
	 */
	public static function get_between_versions(\Datetime $start_date = null, \Datetime $end_date = null) {
		$migrations = self::get_all();
		foreach ($migrations as $key => $migration) {
			if ($start_date !== null) {
				if ($migration->get_version() <= $start_date) {
					unset($migrations[$key]);
					continue;
				}
			}

			if ($end_date !== null) {<commit_msg>Fix typo<commit_after><?php
/**
 * Database migration class
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */

namespace Skeleton\Database;

use Skeleton\Database\Migration\Config;

class Migration {

	/**
	 * Get version
	 *
	 * @access public
	 * @return Datetime $version
	 */
	public function get_version() {
		$classname = get_class($this); // Migration_20150922_203123_Init
		list($migration, $date, $time, $name) = explode('_', $classname);
		return \Datetime::createFromFormat('YmdHis', $date . $time);
	}

	/**
	 * Run
	 *
	 * @access public
	 * @param string up/down
	 */
	public function run($method) {
		$this->$method();
		file_put_contents(Config::$migration_directory . '/db_version', $this->get_version()->format('Ymd His'));
	}

	/**
	 * Get between versions
	 *
	 * @access public
	 * @param Datetime $start_date
	 * @param Datetime $end_date
	 * @return array $migrations
	 */
	public static function get_between_versions(\Datetime $start_date = null, \Datetime $end_date = null) {
		$migrations = self::get_all();
		foreach ($migrations as $key => $migration) {
			if ($start_date !== null) {
				if ($migration->get_version() <= $start_date) {
					unset($migrations[$key]);
					continue;
				}
			}

			if ($end_date !== null) {
{'fraction_non_alphanumeric': 0.16739044611133044, 'fraction_numerical': 0.011054086063955783, 'mean_word_length': 3.7992424242424243, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '3086339', 'n_tokens_mistral': 947, 'n_tokens_neox': 838, 'n_words': 189}