Get a new throttler.

@param mixed $data
@param int   $limit
@param int   $time

@return \GrahamCampbell\Throttle\Throttlers\ThrottlerInterface
198080
public function get($data, int $limit = 10, int $time = 60)
    {
        $transformed = $this->transformer->make($data)->transform($data, $limit, $time);

        if (!array_key_exists($key = $transformed->getKey(), $this->throttlers)) {
            $this->throttlers[$key] = $this->factory->make($transformed);
        }

        return $this->throttlers[$key];
    }
165458
public function limit(int $limit) : Stage\Limit
    {
        $stage = new Stage\Limit($this, $limit);
        $this->addStage($stage);

        return $stage;
    }
3606
protected function buildException(string $key, int $limit, bool $headers)
    {
        $after = $this->limiter->availableIn($key);

        $exception = new ThrottlingException($after, 'Rate limit exceeded.');

        $headers = $this->getHeaders($key, $limit, $headers, $after, $exception->getHeaders());

        $exception->setHeaders($headers);

        return $exception;
    }
645318
public static function createFromDateString($time)
    {
        $interval = parent::createFromDateString($time);
        if ($interval instanceof DateInterval && !($interval instanceof static)) {
            $interval = static::instance($interval);
        }

        return static::instance($interval);
    }
357496
public static function add($key, $data, $time = null)
    {
        if (is_callable($data)) {
            $content = $data();
        } else {
            $content = $data;
        }

        $meta['__bow_meta'] = ['expire_at' => $time == null ? '+' : $time];

        $meta['content'] = $content;

        return (bool) file_put_contents(
            static::makeHashFilename($key, true),
            serialize($meta)
        );
    }
966961
private function throttleBytesPerMinute($timePassed)
    {
        $expectedDuration = $this->getBytesOut() / ($this->rate / 60);

        return (int) ceil($expectedDuration - $timePassed);
    }
180884
public function limit($limit)
    {
        if(!empty($limit))
            $this->selectParams[self::LIMIT] = $limit;
        else
            unset($this->selectParams[self::LIMIT]);
        return $this;
    }
803310
public function limit($skip, $limit)
    {
        $this->limit = $limit;
        $this->skip = $skip;
        return $this;
    }
106344
public function nextOpen(Time $time)
    {
        return $this->openingHoursFilter([
            function ($timeRange) use ($time) {
                return $this->findNextOpenInFreeTime($time, $timeRange);
            },
        ]);
    }
680849
public function paginate($limit)
    {
        $capsule = $this->_database->getCapsule();
        $this->_model = $capsule->table($this->table);
        $paginator = new Pagination();
        $paginator->setLimit($limit)->setModel($this, $this->_model);

        return $paginator->paginate();
    }
527685
public function limit($limit = NULL) {
		if ($limit !== NULL) {
			$limit = intval($limit);
		}
		$this->limit = $limit;
		return $this;
	}
347377
public function setLimit($limit, $field = null)
    {
        $param = $this->buildParam('facet.limit', $field);
        return $this->set($param, $limit);
    }
1314268
public function back($time = 0)
    {
        $this->redirector->setTarget(Request::back());
        $this->redirector->setTime($time);

        return $this;
    }
555347
public function limit(int $number)
    {
        $instance = $this->limitStrategyInstance();

        $instance->limitStrategy()->limit($number);

        return $instance;
    }
300671
public function block($timeout, $callback = null)
    {
        $starting = time();

        while (! $this->acquire()) {
            if (time() - $timeout >= $starting) {
                throw new LimiterTimeoutException;
            }

            usleep(750 * 1000);
        }

        if (is_callable($callback)) {
            $callback();
        }

        return true;
    }
1114628
public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
    {
        if (!$this->container->has(ServerRequestInterface::class)) {
            throw new ScopeException("Unable to create paginator, no request scope found");
        }
        /**
         * @var array $query
         */
        $query = $this->container->get(ServerRequestInterface::class)->getQueryParams();

        //Getting page number
        $page = 0;
        if (!empty($query[$parameter]) && is_scalar($query[$parameter])) {
            $page = (int)$query[$parameter];
        }

        return $this->factory->make(Paginator::class, compact('limit', 'parameter'))->withPage($page);
    }
396208
public function get($limit = null, $offset = null)
    {
        if (isset($limit)) {
            $this->limit($limit, $offset);
        }

        if (false !== ($result = $this->conn->query($this->builderCache))) {
            $result->setTotalRows($this->countAllResults(true));
        }

        $this->builderCache->reset();

        return $result;
    }