src/YearMonthRange.php
public static function of(YearMonth $start, YearMonth $end) : YearMonthRange
    {
        if ($end->isBefore($start)) {
            throw new DateTimeException('The end year-month must not be before the start year-month.');
        }

        return new YearMonthRange($start, $end);
    }
public static function of(YearMonth $start, YearMonth $end) : YearMonthRange
    {
        if ($end->isBefore($start)) {
            throw new DateTimeException('The end year-month must not be before the start year-month.');
        }

        return new YearMonthRange($start, $end);
    }
public static function of ( YearMonth $ start , YearMonth $ end ) : YearMonthRange { if ( $ end -> isBefore ( $ start ) ) { throw new DateTimeException ( 'The end year-month must not be before the start year-month.' ) ; } return new YearMonthRange ( $ start , $ end ) ; }
Creates an instance of YearMonthRange from a start year-month and an end year-month.

@param YearMonth $start The start year-month, inclusive.
@param YearMonth $end   The end year-month, inclusive.

@return YearMonthRange

@throws DateTimeException If the end year-month is before the start year-month.
Creates an instance of YearMonthRange from a start year - month and an end year - month .