src/ICal/ICal.php
protected function trimToRecurrenceCount(array $rrules, array $recurrenceEvents)
    {
        if (isset($rrules['COUNT'])) {
            $recurrenceCount = (intval($rrules['COUNT']) - 1);
            $surplusCount    = (sizeof($recurrenceEvents) - $recurrenceCount);

            if ($surplusCount > 0) {
                $recurrenceEvents  = array_slice($recurrenceEvents, 0, $recurrenceCount);
                $this->eventCount -= $surplusCount;
            }
        }

        return $recurrenceEvents;
    }
protected function trimToRecurrenceCount(array $rrules, array $recurrenceEvents)
    {
        if (isset($rrules['COUNT'])) {
            $recurrenceCount = (intval($rrules['COUNT']) - 1);
            $surplusCount    = (sizeof($recurrenceEvents) - $recurrenceCount);

            if ($surplusCount > 0) {
                $recurrenceEvents  = array_slice($recurrenceEvents, 0, $recurrenceCount);
                $this->eventCount -= $surplusCount;
            }
        }

        return $recurrenceEvents;
    }
protected function trimToRecurrenceCount ( array $ rrules , array $ recurrenceEvents ) { if ( isset ( $ rrules [ 'COUNT' ] ) ) { $ recurrenceCount = ( intval ( $ rrules [ 'COUNT' ] ) - 1 ) ; $ surplusCount = ( sizeof ( $ recurrenceEvents ) - $ recurrenceCount ) ; if ( $ surplusCount > 0 ) { $ recurrenceEvents = array_slice ( $ recurrenceEvents , 0 , $ recurrenceCount ) ; $ this -> eventCount -= $ surplusCount ; } } return $ recurrenceEvents ; }
Ensures the recurrence count is enforced against generated recurrence events.

@param  array $rrules
@param  array $recurrenceEvents
@return array
Ensures the recurrence count is enforced against generated recurrence events .