<commit_before><?php

namespace Brick\DateTime;

/**
 * Base class for Instant and ZonedDateTime.
 */
abstract class ReadableInstant
{
    /**
     * @return \Brick\DateTime\Instant
     */
    abstract public function getInstant();

    /**
     * @return integer
     */
    public function getEpochSecond()
    {
        return $this->getInstant()->getEpochSecond();
    }

    /**
     * @return integer
     */
    public function getNano()
    {
        return $this->getInstant()->getNano();
    }

    /**
     * Compares this instant with another.
     *
     * @param ReadableInstant $that
     *
     * @return integer [-1,0,1] If this instant is before, on, or after the given instant.
     */
    public function compareTo(ReadableInstant $that)
    {
        $seconds = $this->getEpochSecond() - $that->getEpochSecond();

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->getNano() - $that->getNano();

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }

    /**
     * Returns whether this instant equals another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isEqualTo(ReadableInstant $that)
    {
        return $this->compareTo($that) === 0;
    }

    /**
     * Returns whether this instant is after another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isAfter(ReadableInstant $that)
    {
        return $this->compareTo($that) === 1;
    }

    /**
     * Returns whether this instant is before another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isBefore(ReadableInstant $that)
    {
        return $this->compareTo($that) === -1;
    }

    /**
     * Returns whether this instant is in the future.
     *
     * @return boolean
     */
    public function isFuture()
    {
        return $this->isAfter(Instant::now());
    }

    /**
     * Returns whether this instant is in the past.
     *
     * @return boolean
     */
    public function isPast()
    {
        return $this->isBefore(Instant::now());
    }
}
<commit_msg>New ReadableInstant comparison methods<commit_after><?php

namespace Brick\DateTime;

/**
 * Base class for Instant and ZonedDateTime.
 */
abstract class ReadableInstant
{
    /**
     * @return \Brick\DateTime\Instant
     */
    abstract public function getInstant();

    /**
     * @return integer
     */
    public function getEpochSecond()
    {
        return $this->getInstant()->getEpochSecond();
    }

    /**
     * @return integer
     */
    public function getNano()
    {
        return $this->getInstant()->getNano();
    }

    /**
     * Compares this instant with another.
     *
     * @param ReadableInstant $that
     *
     * @return integer [-1,0,1] If this instant is before, on, or after the given instant.
     */
    public function compareTo(ReadableInstant $that)
    {
        $seconds = $this->getEpochSecond() - $that->getEpochSecond();

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->getNano() - $that->getNano();

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }

    /**
     * Returns whether this instant equals another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isEqualTo(ReadableInstant $that)
    {
        return $this->compareTo($that) === 0;
    }

    /**
     * Returns whether this instant is after another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isAfter(ReadableInstant $that)
    {
        return $this->compareTo($that) === 1;
    }

    /**
     * Returns whether this instant is after or equal to another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isAfterOrEqualTo(ReadableInstant $that)
    {
        return $this->compareTo($that) >= 0;
    }

    /**
     * Returns whether this instant is before another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isBefore(ReadableInstant $that)
    {
        return $this->compareTo($that) === -1;
    }

    /**
     * Returns whether this instant is before or equal to another.
     *
     * @param ReadableInstant $that
     *
     * @return boolean
     */
    public function isBeforeOrEqualTo(ReadableInstant $that)
    {
        return $this->compareTo($that) <= 0;
    }

    /**
     * @param ReadableInstant $from
     * @param ReadableInstant $to
     *
     * @return boolean
     */
    public function isBetweenInclusive(ReadableInstant $from, ReadableInstant $to)
    {
        return $this->isAfterOrEqualTo($from) && $this->isBeforeOrEqualTo($to);
    }

    /**
     * @param ReadableInstant $from
     * @param ReadableInstant $to
     *
     * @return boolean
     */
    public function isBetweenExclusive(ReadableInstant $from, ReadableInstant $to)
    {
        return $this->isAfter($from) && $this->isBefore($to);
    }

    /**
     * Returns whether this instant is in the future.
     *
     * @return boolean
     */
    public function isFuture()
    {
        return $this->isAfter(Instant::now());
    }

    /**
     * Returns whether this instant is in the past.
     *
     * @return boolean
     */
    public function isPast()
    {
        return $this->isBefore(Instant::now());
    }
}

{'fraction_non_alphanumeric': 0.12671782973407103, 'fraction_numerical': 0.005711226128859539, 'mean_word_length': 1.9278996865203761, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 40, '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': '7522496', 'n_tokens_mistral': 1725, 'n_tokens_neox': 1678, 'n_words': 417}