src/LocalDate.php
public static function maxOf(LocalDate ...$dates) : LocalDate
    {
        if (! $dates) {
            throw new DateTimeException(__METHOD__ . ' does not accept less than 1 parameter.');
        }

        $max = LocalDate::min();

        foreach ($dates as $time) {
            if ($time->isAfter($max)) {
                $max = $time;
            }
        }

        return $max;
    }
public static function maxOf(LocalDate ...$dates) : LocalDate
    {
        if (! $dates) {
            throw new DateTimeException(__METHOD__ . ' does not accept less than 1 parameter.');
        }

        $max = LocalDate::min();

        foreach ($dates as $time) {
            if ($time->isAfter($max)) {
                $max = $time;
            }
        }

        return $max;
    }
public static function maxOf ( LocalDate ... $ dates ) : LocalDate { if ( ! $ dates ) { throw new DateTimeException ( __METHOD__ . ' does not accept less than 1 parameter.' ) ; } $ max = LocalDate :: min ( ) ; foreach ( $ dates as $ time ) { if ( $ time -> isAfter ( $ max ) ) { $ max = $ time ; } } return $ max ; }
Returns the highest LocalDate among the given values.

@param LocalDate[] $dates The LocalDate objects to compare.

@return LocalDate The latest LocalDate object.

@throws DateTimeException If the array is empty.
Returns the highest LocalDate among the given values .