@param Year $year

@return int
498201
public function getNumberOfDays(Year $year): int
    {
        return $this->getValue() === self::FEBRUARY
            ? ($year->isLeapYear() ? 29 : 28)
            : ($this->getValue() % 2 === 0 ? 30 : 31);
    }
1270767
protected static function isArithmeticLeapYear($year, $yearIsInGeorgian = false) {
        
        // a change for fit
        if ( ! $yearIsInGeorgian) {
            $year += static::HEGIRA_STARTING_YEAR;
        }
        
        $yearPositionInQuadCycle = static::calculateYearInQuadCycle($year) - 1;
        
        $arithmeticBreakPoints = [
            29,
            62,     // (29 + 33)
            95,     // (29 + 33 + 33)
            128,    // (29 + 33 + 33 + 33)
        ];
        
        foreach ($arithmeticBreakPoints as $i => $break) {
            if (isset($arithmeticBreakPoints[$i + 1])) {
                $nextBreak = $arithmeticBreakPoints[$i + 1];
                if ($yearPositionInQuadCycle >= $break && $yearPositionInQuadCycle < $nextBreak) {
                    $yearPositionInQuadCycle -= $break;
                    break;
                }
            }
        }
        
        // the first year is always a common year
        // other years whose ordinal numbers are divisible by 4 are leap years
        $isLeapYear = false;
        if ($yearPositionInQuadCycle != 0 && ($yearPositionInQuadCycle % 4) == 0) {
            $isLeapYear = true;
        }
        
        return $isLeapYear;
    }
1053599
public function plusYears(int $years) : YearMonth
    {
        if ($years === 0) {
            return $this;
        }

        return $this->withYear($this->year + $years);
    }
411261
public function getYear()
    {
        if (empty($this->year)) {
            throw new LogicException(
                sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'year')
            );
        }
        return $this->year;
    }
747334
public function getYear()
  {
    if (strlen($this->date) >= 4) {
      $year = substr($this->date, 0, 4);
      $year = str_replace('?', '', $year);

      return ($year ? (int) $year : null);
    }

    return null;
  }
1353614
public function isLeapYear($year='') {
        if(empty($year)) {
            $year = $this->year;
        }
        return ((($year % 4) == 0) && (($year % 100) != 0) || (($year % 400) == 0));
    }
322024
public function withYear(int $year) : YearMonth
    {
        if ($year === $this->year) {
            return $this;
        }

        Field\Year::check($year);

        return new YearMonth($year, $this->month);
    }
915208
public function isValidYear(int $year) : bool
    {
        return $this->month !== 2 || $this->day !== 29 || Field\Year::isLeap($year);
    }
1200088
private function yearType($year)
    {
        $year_length = $this->yToJd($year + 1) - $this->yToJd($year);

        if ($year_length === 353 || $year_length === 383) {
            return self::DEFECTIVE_YEAR;
        } elseif ($year_length === 355 || $year_length === 385) {
            return self::COMPLETE_YEAR;
        } else {
            return self::REGULAR_YEAR;
        }
    }
1246558
function setYear( $year )
    {
        $arr = getdate( $this->DateTime );
        $this->DateTime = mktime( $arr['hours'], $arr['minutes'], $arr['seconds'],
                                  $arr['mon'], $arr['mday'], $year );
    }
937778
public void setYear(int year){
        if(mAdapter.getYear() == year)
            return;

        mAdapter.setYear(year);
        goTo(year);
    }
543014
public static function fromYear(int $year): string
    {
        // note this checks SeasonYearParam::FORMAT (YYYY), not self::FORMAT
        if (preg_match(SeasonYearParam::FORMAT, (string) $year) !== 1) {
            throw new \InvalidArgumentException('Year must be an integer in YYYY format');
        }

        return $year.'-'.substr((string) ($year + 1), -2);
    }
37281
public static function DaysInYear(int $year)
    {
        $period_from_carbon = \Phunc\Year::FirstDayInYearCarbon($year);
        $days_in_year = 365 + $period_from_carbon->format('L');
        return $days_in_year;
    }
625398
public function plusYears(int $years) : YearWeek
    {
        if ($years === 0) {
            return $this;
        }

        return $this->withYear($this->year + $years);
    }
11000
public function year($value = null)
    {
        if ($value !== null) {
            if ($value < 0 || $value > 9999) {
                $this->year = 0;
            } else {
                $this->year = $value;
            }
        }
        return $this->year;
    }
541700
public static function isLeapYear($year) {
	    $mod = ($year % 33);
	    if (($mod == 1) or ( $mod == 5) or ( $mod == 9) or ( $mod == 13) or ( $mod == 17) or ( $mod == 22) or ( $mod == 26) or ( $mod == 30)) {
	        return true;
	    }
	    return false;
	}
351327
public function isLeapYear(int $year = null) : bool
    {
        return !!date(
            'L',
            $year === null ? $this->getTimestamp() : mktime(1, 1, 1, 2, 1, $year)
        );
    }