@param mixed   $value
@param Counter $counter
@param int     $number

@return Counter
510168
protected function handleIncrement($value, Counter $counter, int $number): Counter
    {
        if (false === $value) {
            $counter = $this->set(Counter::create($counter->getName(), $counter->getValue() + $number));
        } else {
            $counter = Counter::create($counter->getName(), $value);
        }

        return $counter;
    }
1008516
public function set($key, $value)
    {
        switch ($key) {
            case 'quantity':
                $this->setCheckTypeInteger($value, $key);
            break;
            case 'price':
            case 'tax':
                $this->setCheckIsNumeric($value, $key);

                $value = (float) $value;
        }

        $this->data[$key] = $value;

        return $this->getId();
    }
930793
protected function toNumber($value)
    {
        if (is_numeric($value)) {
            return $value + 0; // cast to number
        }
        if (is_bool($value) || is_null($value)) {
            return (int) $value;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toNumber(reset($value));
        }

        return $value;
    }
57208
public static function counter(string $className, array $counters, array $condition = [])
    {
        $instance = self::getInstance($className);
        $query    = Query::table($className)->className($className)->selectInstance($instance);

        if (!empty($condition)) {
            $query = $query->condition($condition);
        }

        return $query->counter($counters);
    }
246950
public function deleteFirst($value, int $count = 1): int
    {
        return $this->handle->lRem($this->name, $value, $count);
    }
1319769
public function setNumberOfLeadingZeros($value)
    {
        $this->hasNumberOfLeadingZeros = true;
        $this->numberOfLeadingZeros = (int) $value;
        return $this;
    }
955168
public function incrementCounter($name, $value = 1) {
        if (!isset($this->counters[$name])) {
            $this->counters[$name] = 0;
        }
        $this->counters[$name] += $value;
    }
795106
public function checkDigits($value, $count)
    {

        if (is_numeric($value)) {
            $value = "$value";
        }

        if (!Type::isStringLike($value)) {
            return false;
        }

        return ! preg_match('/[^0-9]/', "$value")
            && strlen("$value") == $count;
    }
1004471
public function plus($number)
    {
        self::mustBeNumeric($number, 'Value to add');
        
        $number = is_object($number) ? $number->value : $number;

        return new self($this->value + $number);
    }
893282
public function setAmount($value)
    {
        if (empty($value)) {
            $this->currentObject->setAmount(null);
        } elseif ($value instanceof AmountInterface) {
            if ($value->getValue() > 0.0) {
                $this->currentObject->setAmount($value->getValue());
            }
            $this->currentObject->setCurrency($value->getCurrency());
        } else {
            $this->currentObject->setAmount($value);
        }
        return $this;
    }
301865
public function count($value)
    {
        if (is_array($value) === true || $value instanceof Countable) {
            return count($value);
        } elseif ($value instanceof IteratorAggregate) {
            // Note: getIterator() returns a Traversable, not an Iterator
            // thus rewind() and valid() methods may not be present
            return iterator_count($value->getIterator());
        } elseif ($value instanceof Iterator) {
            if ($value instanceof Generator) {
                return 1;
            }
            return iterator_count($value);
        } elseif ($value instanceof PDOStatement) {
            return $value->rowCount();
        } elseif ($value instanceof Traversable) {
            return iterator_count($value);
        } elseif ($value instanceof ArrayAccess) {
            if ($value->offsetExists(0)) {
                return 1;
            }
        } elseif (is_object($value)) {
            return count($value);
        }
        return 0;
    }
440919
public function increment($key, $value = 1)
    {
        $data   = $this->getData($key);
        $result = intval($data['data']) + $value;
        $this->set($key, $result, $data['time']);

        return $result;
    }
9145
public function setCurrent($value)
    {
        if (!StaticValidator::isValid('number', $value)) {
            return $this;
        }

        $this->_current = StaticFilter::filter('number',$value);
        $this->_offset = $this->_rowsPerPage * ($this->_current - 1);
        return $this;
    }
521042
public function addDiscount($value)
    {
        $this->data->amount->subtotals->discount -= $this->convertAmount($value);

        return $this;
    }
474677
public function increment($key, $value = 1)
    {
        if ($this->exists($key)) {
            return self::$redis->incrBy($key, $value);
        } else {
            $this->set($key, $value);

            return $value;
        }
    }
1121322
public function incrementMemberCount($value){
        if(!is_integer($value)){
            return $this;
        }
        $this->count_members = $this->count_members + $value;
        return $this;
    }
930943
public function guessFilterValue(
        Result $result,
        Aggregation $aggregation,
        Counter $counter
    ): string {
        return $counter->isUsed()
            ? $this->removeFilterValue(
                $result,
                $aggregation->getName(),
                $counter->getId()
            )
            : $this->addFilterValue(
                $result,
                $aggregation->getName(),
                $counter->getId()
            );
    }