src/Carbon/CarbonPeriod.php
protected function incrementCurrentDateUntilValid()
    {
        $attempts = 0;

        do {
            $this->current = $this->current->add($this->dateInterval);

            $this->validationResult = null;

            if (++$attempts > static::NEXT_MAX_ATTEMPTS) {
                throw new RuntimeException('Could not find next valid date.');
            }
        } while ($this->validateCurrentDate() === false);
    }
protected function incrementCurrentDateUntilValid()
    {
        $attempts = 0;

        do {
            $this->current = $this->current->add($this->dateInterval);

            $this->validationResult = null;

            if (++$attempts > static::NEXT_MAX_ATTEMPTS) {
                throw new RuntimeException('Could not find next valid date.');
            }
        } while ($this->validateCurrentDate() === false);
    }
protected function incrementCurrentDateUntilValid ( ) { $ attempts = 0 ; do { $ this -> current = $ this -> current -> add ( $ this -> dateInterval ) ; $ this -> validationResult = null ; if ( ++ $ attempts > static :: NEXT_MAX_ATTEMPTS ) { throw new RuntimeException ( 'Could not find next valid date.' ) ; } } while ( $ this -> validateCurrentDate ( ) === false ) ; }
Keep incrementing the current date until a valid date is found or the iteration is ended.

@throws \RuntimeException

@return void
Keep incrementing the current date until a valid date is found or the iteration is ended .