src/DayOfWeek.php
public static function all(DayOfWeek $first = null) : array
    {
        $days = [];
        $first = $first ?: DayOfWeek::get(DayOfWeek::MONDAY);
        $current = $first;

        do {
            $days[] = $current;
            $current = $current->plus(1);
        }
        while (! $current->isEqualTo($first));

        return $days;
    }
public static function all(DayOfWeek $first = null) : array
    {
        $days = [];
        $first = $first ?: DayOfWeek::get(DayOfWeek::MONDAY);
        $current = $first;

        do {
            $days[] = $current;
            $current = $current->plus(1);
        }
        while (! $current->isEqualTo($first));

        return $days;
    }
public static function all ( DayOfWeek $ first = null ) : array { $ days = [ ] ; $ first = $ first ? : DayOfWeek :: get ( DayOfWeek :: MONDAY ) ; $ current = $ first ; do { $ days [ ] = $ current ; $ current = $ current -> plus ( 1 ) ; } while ( ! $ current -> isEqualTo ( $ first ) ) ; return $ days ; }
Returns the seven days of the week in an array.

@param DayOfWeek|null $first The day to return first. Optional, defaults to Monday.

@return DayOfWeek[]
Returns the seven days of the week in an array .