<commit_before><?php

namespace OpenCafe\Tools;

/**
 * Define Day of current date.
 */
class DayOf
{

    protected $date_time;

    protected $month;

    protected $day;

    protected $config;

    protected $result;

    protected $calendar_type;

    protected $geregorian_DayofWeek;

    public function __construct($date_time, $calendar_type = 'gregorian')
    {

        $this->config = include __DIR__.'/Config.php';

        $this->date_time = $date_time;

        $this->calendar_type = $calendar_type;

        return $this;

    }

    /**
   * Which day of year is current day.
   *
   * @since  Aug, 03 2015
   * @return integer
   */
    public function year()
    {

        $this->config = include __DIR__.'/CalendarSettings/' . ucfirst($this->calendar_type) . '.php';

        return $this->config[ 'day_of_year' ]( $this->date_time );

    }


    /**
   * Which day of week is current day.
   *
   * @since  Aug, 09 2015
   * @return integer
   */
    public function week()
    {

        $this->config = include __DIR__.'/CalendarSettings/' . ucfirst($this->calendar_type) . '.php';

        return $this->config[ 'day_of_week' ]( $this->date_time );

    }

	/**
	 * Return last day of current month
	 *
	 * @since  Oct, 18 2016
	 * @return integer
	 */
	public function lastDayMonth() {

		$this->config = include __DIR__.'/CalendarSettings/' . ucfirst($this->calendar_type) . '.php';

		$days = 0;

		switch ( $this->calendar_type ) {

			case 'gregorian':

				if ( intval( $this->date_time->format( 'm' ) ) == 2 &&
				      $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) )
					$days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1;<commit_msg>Added some changes on DayOf.php<commit_after><?php

namespace OpenCafe\Tools;

/**
 * Define Day of current date.
 */
class DayOf
{
	/**
     * @var object
     */
    protected $date_time;

	/**
     * @var array
     */
    protected $config;

	/**
	 * @var string
	 */
	protected $calendar_type;

	/**
   	 * Constructor of DayOf class
     */
    public function __construct($date_time, $calendar_type = 'gregorian')
    {

		$this->config = include __DIR__.'/CalendarSettings/' . ucfirst($calendar_type) . '.php';

		$this->calendar_type = $calendar_type;

        $this->date_time = $date_time;

        return $this;

    }

    /**
   * Which day of year is current day.
   *
   * @since  Aug, 03 2015
   * @return integer
   */
    public function year()
    {

        return $this->config[ 'day_of_year' ]( $this->date_time );

    }


    /**
   * Which day of week is current day.
   *
   * @since  Aug, 09 2015
   * @return integer
   */
    public function week()
    {

        return $this->config[ 'day_of_week' ]( $this->date_time );

    }

	/**
	 * Return last day of current month
	 *
	 * @since  Oct, 18 2016
	 * @return integer
	 */
	public function lastDayMonth() {

		$days = 0;

		switch ( $this->calendar_type ) {

			case 'gregorian':

				if ( intval( $this->date_time->format( 'm' ) ) == 2 &&
				      $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) )
					$days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1;
{'fraction_non_alphanumeric': 0.1567534076827757, 'fraction_numerical': 0.013011152416356878, 'mean_word_length': 2.4133192389006344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '1621978', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1057, 'n_words': 252}