<commit_before><?php namespace Mobileka\L3\Engine\Laravel;

use Mobileka\L3\Engine\Laravel\Helpers\Arr,
	Mobileka\L3\Engine\Laravel\Lang;

class Date {

	public $date;

	public static function translate($date, $lang = 'ru', $delimiter = '-', $dayIndex = 0, $monthIndex = 1)
	{
		$result = array();
		$yearIndex = $dayIndex ? 0 : 2;
		$date = explode($delimiter, $date);

		$result[$dayIndex] = Arr::getItem($date, $dayIndex, '01');
		$result[$yearIndex] = Arr::getItem($date, $yearIndex, '1970');

		$month = (int)Arr::getItem($date, $monthIndex, 1);
		$result[$monthIndex] = Lang::line('months.'.($month - 1), array(), $lang)->get();
		ksort($result);

		return implode($delimiter, $result);
	}

	public static function make($date = '')
	{
		$self = new static;
		$self->date = (is_string($date)) ? date_create($date) : $date;
		return $self;
	}

	public function subDays($num)
	{
		$this->date = date_sub($this->date, date_interval_create_from_date_string("$num days"));
		return $this;
	}

	public function addDays($num)
	{
		$this->date = date_add($this->date, date_interval_create_from_date_string("$num days"));
		return $this;
	}

	public function get($format = 'Y-m-d')
	{
		return date_format($this->date, $format);
	}

}<commit_msg>Fixes a small problem in Date class<commit_after><?php namespace Mobileka\L3\Engine\Laravel;

use Mobileka\L3\Engine\Laravel\Helpers\Arr,
	Mobileka\L3\Engine\Laravel\Lang;

class Date {

	public $date;

	public static function translate($date, $lang = 'ru', $delimiter = '-', $dayIndex = 0, $monthIndex = 1)
	{
		$result = array();
		$yearIndex = $dayIndex ? 0 : 2;
		$date = explode($delimiter, $date);

		$result[$dayIndex] = Arr::getItem($date, $dayIndex, '01');
		$result[$yearIndex] = Arr::getItem($date, $yearIndex, '1970');

		$month = (int)Arr::getItem($date, $monthIndex, 1);
		$result[$monthIndex] = Lang::line('months.'.($month - 1), array(), $lang)->get();
		ksort($result);

		return implode($delimiter, $result);
	}

	public static function make($date = '')
	{
		$self = new static;
		$date = $date ? : '';
		$self->date = (is_string($date)) ? date_create($date) : $date;
		return $self;
	}

	public function subDays($num)
	{
		$this->date = date_sub($this->date, date_interval_create_from_date_string("$num days"));
		return $this;
	}

	public function addDays($num)
	{
		$this->date = date_add($this->date, date_interval_create_from_date_string("$num days"));
		return $this;
	}

	public function get($format = 'Y-m-d')
	{
		return date_format($this->date, $format);
	}

}
{'fraction_non_alphanumeric': 0.19288537549407114, 'fraction_numerical': 0.011857707509881422, 'mean_word_length': 4.765375854214123, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5376955', 'n_tokens_mistral': 995, 'n_tokens_neox': 922, 'n_words': 186}