src/DateRepetition/DateRepetitionCalculator.php
public function getNextOccurence(DateRepetition $dateRepetition, DateTime $datetime = null)
    {
        if(null === $datetime) {
            $datetime = $this->timeProvider->now();
        }

        switch(true) {
            case $dateRepetition instanceof WeeklyDateRepetition:
                return $this->getNextOccurenceForWeeklyDateRepetition($dateRepetition, $datetime);
            case $dateRepetition instanceof DailyDateRepetition:
                return $this->getNextOccurenceForDailyDateRepetition($dateRepetition, $datetime);
            case $dateRepetition instanceof HourlyDateRepetition:
                return $this->getNextOccurenceForHourlyDateRepetition($dateRepetition, $datetime);
        }

        return new \Exception('Not yet implemented');
    }
public function getNextOccurence(DateRepetition $dateRepetition, DateTime $datetime = null)
    {
        if(null === $datetime) {
            $datetime = $this->timeProvider->now();
        }

        switch(true) {
            case $dateRepetition instanceof WeeklyDateRepetition:
                return $this->getNextOccurenceForWeeklyDateRepetition($dateRepetition, $datetime);
            case $dateRepetition instanceof DailyDateRepetition:
                return $this->getNextOccurenceForDailyDateRepetition($dateRepetition, $datetime);
            case $dateRepetition instanceof HourlyDateRepetition:
                return $this->getNextOccurenceForHourlyDateRepetition($dateRepetition, $datetime);
        }

        return new \Exception('Not yet implemented');
    }
public function getNextOccurence ( DateRepetition $ dateRepetition , DateTime $ datetime = null ) { if ( null === $ datetime ) { $ datetime = $ this -> timeProvider -> now ( ) ; } switch ( true ) { case $ dateRepetition instanceof WeeklyDateRepetition : return $ this -> getNextOccurenceForWeeklyDateRepetition ( $ dateRepetition , $ datetime ) ; case $ dateRepetition instanceof DailyDateRepetition : return $ this -> getNextOccurenceForDailyDateRepetition ( $ dateRepetition , $ datetime ) ; case $ dateRepetition instanceof HourlyDateRepetition : return $ this -> getNextOccurenceForHourlyDateRepetition ( $ dateRepetition , $ datetime ) ; } return new \ Exception ( 'Not yet implemented' ) ; }
Find next occurence of date repetition

@param DateRepetition
@param DateTime next occurence from this date (null == now)
@return DateTime date/time of next occurence
Find next occurence of date repetition