Increment a counter using the EZ API.

@see https://www.stathat.com/manual/send#ez
@param string $stat - Unique stat name
@param int $count - Number you want to count
@throws \Exception
436001
public function ezCount($stat, $count = 1)
    {
        if (! isset($this->config['ez_key'])) {
            throw new Exception('StatHat EZ key not set.');
        }

        // If a prefix is set, prepend it to the stat name.
        if (! empty($this->config['prefix'])) {
            $stat = $this->config['prefix'].$stat;
        }

        $this->post('ez', ['ezkey' => $this->config['ez_key'], 'stat' => $stat, 'count' => $count]);
    }
379214
public function update( $count ) {
		update_post_meta(
			$this->post_id,
			'_inc2734_count_cache_' . $this->service_name,
			[
				'count'      => $count,
				'expiration' => time() + (int) apply_filters( 'inc2734_wp_share_buttons_count_cache_seconds', 60 * 5 ),
			]
		);
	}
531474
public function count($count = null)
    {
        if ($count === null) {
            return isset($this->options['count']) ? $this->options['count'] : 0;
        } else {
            $this->options['count'] = $count;
            return $this;
        }
    }
138686
public function limit($sql, $count, $offset = 0)
     {
        $count = intval($count);
        if ($count <= 0) {
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
        }

        $offset = intval($offset);
        if ($offset < 0) {
            /** @see Zend_Db_Adapter_Exception */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
        }

        if ($offset == 0) {
            $sql = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . $count . ' ', $sql);
        } else {
            $orderby = stristr($sql, 'ORDER BY');

            if (!$orderby) {
                $over = 'ORDER BY (SELECT 0)';
            } else {
                $over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby);
            }

            // Remove ORDER BY clause from $sql
            $sql = preg_replace('/\s+ORDER BY(.*)/', '', $sql);

            // Add ORDER BY clause as an argument for ROW_NUMBER()
            $sql = "SELECT ROW_NUMBER() OVER ($over) AS \"ZEND_DB_ROWNUM\", * FROM ($sql) AS inner_tbl";

            $start = $offset + 1;
            $end = $offset + $count;

            $sql = "WITH outer_tbl AS ($sql) SELECT * FROM outer_tbl WHERE \"ZEND_DB_ROWNUM\" BETWEEN $start AND $end";
        }

        return $sql;
    }
306356
public function addCount($sources=  array()) {
		$counter = 0;
		foreach ($sources as $value) {
			$this->parent->addOnTheFlyAttribute('count'.$counter , new \SimplOn\Datas\Count('count('.$value.')',$value));
			$counter +=1;
		}
	}
7093
public function hitLimits($region, $count = 1)
	{
		foreach ($this->limits as $limit)
		{
			if ($limit->getRegion() == $region &&
				! $limit->hit($count)
			)
			{
				return false;
			}
		}

		return true;
	}
53795
public function counting($name, $hit, $total = null)
    {
        if (!is_string($name) || empty($name)) {
            return;
        }
        if (!isset($this->_countings[$name])) {
            $this->_countings[$name] = ['hit' => 0, 'total' => 0];
        }
        $this->_countings[$name]['hit'] += intval($hit);
        if ($total !== null) {
            $this->_countings[$name]['total'] += intval($total);
        }
    }
136003
public function count($count, $error) {
        if ($this->_exist) {
            array_push($this->_constraints, ['type' => self::COUNT, 'value' => $count, 'message' => $error]);
        }

        return $this;
    }
61489
private function addTokenToVector($token, $field, $count = 1)
    {
        if (!empty($token)) {
            if (isset($this->tokenVector[$field][$token])) {
                $this->tokenVector[$field][$token] += $count;
            } else {
                $this->tokenVector[$field][$token] = $count;
            }
        }
    }
1173684
private function walk($count = 1)
    {
        $token = $nextToken = $this->lexer->token;

        for ($i = 0; ($i < $count) || ($token === $nextToken); ++$i) {
            $this->lexer->moveNext();
            $nextToken = $this->lexer->token;
        }

        return $nextToken;
    }
1166803
public function setCount(int $count, string $type = self::INFO): void
	{
		if ($count > 0) {
			switch ($type) {
				default:
					throw new InvalidArgumentException("Wrong argument 'type'");
				case self::INFO:
				case self::WARNING:
					break;
			}
			$this->count = $count;
			$this->type = $type;
		}
	}
1315227
public function count($count = false): int
    {
        // 如果不传递参数,返回记录总数
        if ($count === false) {
            return $this->count;
        }

        // 记录总数
        $this->count = intval($count);

        // 计算总页数
        $this->allPage = ceil($count / $this->size);

        // 调整当前页数,不能大于总页数
        $this->page = max(1, min($this->page, $this->allPage));

        return $this->count;
    }
1211486
public function endingDailyAfterCount($count)
    {
        if (false == is_int($count) || $count <= 0) {
            throw new \InvalidArgumentException('Ending daily after count must be a positive number!');
        }

        if (null == $this->startTimeOfDay) {
            throw new \InvalidArgumentException('You must set the startDailyAt() before calling this endingDailyAfterCount()!');
        }

        $today = new \DateTime();
        $startTimeOfDayDate = $this->getTimeOfDayForDate($today, $this->startTimeOfDay);
        $maxEndTimeOfDayDate = (clone $today)->setTime(23, 59, 59);
        $remainingSecondsInDay = ((int) $maxEndTimeOfDayDate->format('U')) - ((int) $startTimeOfDayDate->format('U'));

        if ($this->intervalUnit == IntervalUnit::SECOND) {
            $intervalInSeconds = $this->interval;
        } elseif ($this->intervalUnit == IntervalUnit::MINUTE) {
            $intervalInSeconds = $this->interval * 60;
        } elseif ($this->intervalUnit == IntervalUnit::HOUR) {
            $intervalInSeconds = $this->interval * 60 * 24;
        } else {
            throw new \InvalidArgumentException(sprintf('The IntervalUnit is invalid for this trigger: "%s"', $this->intervalUnit));
        }

        if ($remainingSecondsInDay - $intervalInSeconds <= 0) {
            throw new \InvalidArgumentException('The startTimeOfDay is too late with given Interval and IntervalUnit values.');
        }

        $maxNumOfCount = ($remainingSecondsInDay / $intervalInSeconds);
        if ($count > $maxNumOfCount) {
            throw new \InvalidArgumentException(sprintf('The given count is too large!: count: "%s", max: "%s"', $count, $maxNumOfCount));
        }

        $incrementInSeconds = ($count - 1) * $intervalInSeconds;
        $endTimeOfDayDate = clone $startTimeOfDayDate;
        $endTimeOfDayDate->add(new \DateInterval(sprintf('PT%dS', $incrementInSeconds)));

        if ($endTimeOfDayDate > $maxEndTimeOfDayDate) {
            throw new \InvalidArgumentException(sprintf('The given count is too large!: count: "%s", max: "%s"', $count, $maxNumOfCount));
        }

        $this->endTimeOfDay = $endTimeOfDayDate;

        return $this;
    }
1141958
public void incrementCounter(BugChecker bugChecker, String key, int count) {
    statisticsCollector.incrementCounter(statsKey(bugChecker.canonicalName() + "-" + key), count);
  }
94943
public function limit($count = null, $offset = null)
    {
        $this->_parts[self::LIMIT_COUNT]  = (int) $count;
        $this->_parts[self::LIMIT_OFFSET] = (int) $offset;
        return $this;
    }
1111554
public void count(final Stat name, final int count) {
        Integer value = counters.get(name);
        value = value == null ? count : value + count;
        counters.put(name, value);
    }
764892
public function countByValue($min = '-inf', $max = '+inf'): int
    {
        return $this->handle->zCount($this->name, strval($min), strval($max));
    }