src/LocalDateRange.php
public static function of(LocalDate $startDate, LocalDate $endDate) : LocalDateRange
    {
        if ($endDate->isBefore($startDate)) {
            throw new DateTimeException('The end date must not be before the start date.');
        }

        return new LocalDateRange($startDate, $endDate);
    }
public static function of(LocalDate $startDate, LocalDate $endDate) : LocalDateRange
    {
        if ($endDate->isBefore($startDate)) {
            throw new DateTimeException('The end date must not be before the start date.');
        }

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

@param LocalDate $startDate The start date, inclusive.
@param LocalDate $endDate   The end date, inclusive.

@return LocalDateRange

@throws DateTimeException If the end date is before the start date.
Creates an instance of LocalDateRange from a start date and an end date .