protected function calculateNextTimeout(TimerInterface $timer)
    {

        // try to load the interval
        $intervalDuration = $timer->getIntervalDuration();

        // check if we've a interval
        if ($intervalDuration > 0) {
            // load the next expiration date
            $nextExpiration = $timer->getNextExpiration();

            // compute and return the next expiration date
            return $nextExpiration->add(new \DateInterval(sprintf('PT%sS', $intervalDuration / 1000000)));
        }

        // return nothing
        return null;
    }
protected function calculateNextTimeout(TimerInterface $timer)
    {

        // try to load the interval
        $intervalDuration = $timer->getIntervalDuration();

        // check if we've a interval
        if ($intervalDuration > 0) {
            // load the next expiration date
            $nextExpiration = $timer->getNextExpiration();

            // compute and return the next expiration date
            return $nextExpiration->add(new \DateInterval(sprintf('PT%sS', $intervalDuration / 1000000)));
        }

        // return nothing
        return null;
    }
protected function calculateNextTimeout ( TimerInterface $ timer ) { // try to load the interval $ intervalDuration = $ timer -> getIntervalDuration ( ) ; // check if we've a interval if ( $ intervalDuration > 0 ) { // load the next expiration date $ nextExpiration = $ timer -> getNextExpiration ( ) ; // compute and return the next expiration date return $ nextExpiration -> add ( new \ DateInterval ( sprintf ( 'PT%sS' , $ intervalDuration / 1000000 ) ) ) ; } // return nothing return null ; }
Calculates and returns the next timeout for the passed timer.

@param \AppserverIo\Psr\EnterpriseBeans\TimerInterface $timer The timer we want to calculate the next timeout for

@return \DateTime|null The next expiration timeout
Calculates and returns the next timeout for the passed timer .