src/Year.php
public function compareTo(Year $that) : int
    {
        if ($this->year > $that->year) {
            return 1;
        }

        if ($this->year < $that->year) {
            return -1;
        }

        return 0;
    }
public function compareTo(Year $that) : int
    {
        if ($this->year > $that->year) {
            return 1;
        }

        if ($this->year < $that->year) {
            return -1;
        }

        return 0;
    }
public function compareTo ( Year $ that ) : int { if ( $ this -> year > $ that -> year ) { return 1 ; } if ( $ this -> year < $ that -> year ) { return - 1 ; } return 0 ; }
Compares this year to another year.

@param Year $that The year to compare to.

@return int [-1, 0, 1] If this year is before, equal to, or after the given year.
Compares this year to another year .