public static function getLength(int $monthOfYear, int $year = null) : int
    {
        switch ($monthOfYear) {
            case 2:
                return ($year === null || Year::isLeap($year)) ? 29 : 28;

            case 4:
            case 6:
            case 9:
            case 11:
                return 30;

            default:
                return 31;
        }
    }