private function advanceToNextDayOfWeekIfNecessary(\DateTime $fireTime, $forceToAdvanceNextDay)
    {
        // a. Advance or adjust to next dayOfWeek if need to first, starting next day with startTimeOfDay.
        $sTimeOfDay = $this->getStartTimeOfDay();
        $fireTimeStartDate = $this->getTimeOfDayForDate($fireTime, $sTimeOfDay);
        $dayOfWeekOfFireTime = (int) $fireTimeStartDate->format('N');

        // b2. We need to advance to another day if isAfterTimePassEndTimeOfDay is true, or dayOfWeek is not set.
        $daysOfWeekToFire = $this->getDaysOfWeek();
        if ($forceToAdvanceNextDay || false == in_array($dayOfWeekOfFireTime, $daysOfWeekToFire, true)) {
            // Advance one day at a time until next available date.
            for ($i = 1; $i <= 7; $i++) {
                $fireTimeStartDate->add(new \DateInterval('P1D'));
                $dayOfWeekOfFireTime = (int) $fireTimeStartDate->format('N');
                if (in_array($dayOfWeekOfFireTime, $daysOfWeekToFire, true)) {
                    $fireTime = $fireTimeStartDate;

                    break;
                }
            }
        }

        // Check fireTime not pass the endTime
        $endTime = $this->getEndTime();
        if ($endTime && $fireTime > $endTime) {
            return null;
        }

        return $fireTime;
    }