src/Services/DateTime.php
private function next($dayOfWeek)
    {
        $days = [
            self::SUNDAY    => 'Sunday',
            self::MONDAY    => 'Monday',
            self::TUESDAY   => 'Tuesday',
            self::WEDNESDAY => 'Wednesday',
            self::THURSDAY  => 'Thursday',
            self::FRIDAY    => 'Friday',
            self::SATURDAY  => 'Saturday',
        ];

        $dow = $days[$dayOfWeek];

        return $this->startOfDay()->modify("next $dow");
    }
private function next($dayOfWeek)
    {
        $days = [
            self::SUNDAY    => 'Sunday',
            self::MONDAY    => 'Monday',
            self::TUESDAY   => 'Tuesday',
            self::WEDNESDAY => 'Wednesday',
            self::THURSDAY  => 'Thursday',
            self::FRIDAY    => 'Friday',
            self::SATURDAY  => 'Saturday',
        ];

        $dow = $days[$dayOfWeek];

        return $this->startOfDay()->modify("next $dow");
    }
private function next ( $ dayOfWeek ) { $ days = [ self :: SUNDAY => 'Sunday' , self :: MONDAY => 'Monday' , self :: TUESDAY => 'Tuesday' , self :: WEDNESDAY => 'Wednesday' , self :: THURSDAY => 'Thursday' , self :: FRIDAY => 'Friday' , self :: SATURDAY => 'Saturday' , ] ; $ dow = $ days [ $ dayOfWeek ] ; return $ this -> startOfDay ( ) -> modify ( "next $dow" ) ; }
Modify to the next occurrence of a given day of the week.

If no dayOfWeek is provided, modify to the next occurrence of the current day of the week.
Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY.

@param int $dayOfWeek
@return static
Modify to the next occurrence of a given day of the week .