<commit_before><?php

use Composer\Package\LinkConstraint\MultiConstraint;
use Composer\Package\LinkConstraint\VersionConstraint;

/**
 * A SilverStripe version which an extension can be compatible with.
 */
class SilverStripeVersion extends DataObject {

	public static $db = array(
		'Name' => 'Varchar(10)',
		'Major' => 'Int',
		'Minor' => 'Int'
	);

	/**
	 * @return Composer\Package\LinkConstraint\LinkConstraintInterface
	 */
	public function getConstraint() {
		$next = $this->Major . '.' . ($this->Minor + 1);

		return new MultiConstraint(array(
			new VersionConstraint('>=', "$this->Major.$this->Minor.0.0"),
			new VersionConstraint('<', "$next.0.0")
		));
	}

}<commit_msg>Sort SilverStripe versions by newest first.<commit_after><?php

use Composer\Package\LinkConstraint\MultiConstraint;
use Composer\Package\LinkConstraint\VersionConstraint;

/**
 * A SilverStripe version which an extension can be compatible with.
 */
class SilverStripeVersion extends DataObject {

	public static $db = array(
		'Name' => 'Varchar(10)',
		'Major' => 'Int',
		'Minor' => 'Int'
	);

	public static $default_sort = array(
		'Major' => 'DESC',
		'Minor' => 'DESC'
	);

	/**
	 * @return Composer\Package\LinkConstraint\LinkConstraintInterface
	 */
	public function getConstraint() {
		$next = $this->Major . '.' . ($this->Minor + 1);

		return new MultiConstraint(array(
			new VersionConstraint('>=', "$this->Major.$this->Minor.0.0"),
			new VersionConstraint('<', "$next.0.0")
		));
	}

}
{'fraction_non_alphanumeric': 0.16733870967741934, 'fraction_numerical': 0.009408602150537635, 'mean_word_length': 4.280141843971631, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '6639036', 'n_tokens_mistral': 516, 'n_tokens_neox': 472, 'n_words': 107}