src/Krucas/Counter/Counter.php
protected function decrementForPeriod($key, $value, \DatePeriod $period)
    {
        $ranges = $this->getRanges($period);

        if (count($ranges) > 0) {
            foreach ($ranges as $range) {
                $range instanceof DateRange
                    ? $this->repository->decrementForRange($key, $range->getStartDate(), $range->getEndDate(), $value)
                    : $this->repository->decrementFor($key, $range, $value);
            }
        }
    }
protected function decrementForPeriod($key, $value, \DatePeriod $period)
    {
        $ranges = $this->getRanges($period);

        if (count($ranges) > 0) {
            foreach ($ranges as $range) {
                $range instanceof DateRange
                    ? $this->repository->decrementForRange($key, $range->getStartDate(), $range->getEndDate(), $value)
                    : $this->repository->decrementFor($key, $range, $value);
            }
        }
    }
protected function decrementForPeriod ( $ key , $ value , \ DatePeriod $ period ) { $ ranges = $ this -> getRanges ( $ period ) ; if ( count ( $ ranges ) > 0 ) { foreach ( $ ranges as $ range ) { $ range instanceof DateRange ? $ this -> repository -> decrementForRange ( $ key , $ range -> getStartDate ( ) , $ range -> getEndDate ( ) , $ value ) : $ this -> repository -> decrementFor ( $ key , $ range , $ value ) ; } } }
Decrement value for a given period.

@param string $key Counter key.
@param float|int $value Decrement by value.
@param \DatePeriod $period Date period.
@return void
Decrement value for a given period .