for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Rate Limit package.
*
* Copyright (c) Nikola Posa
* For full copyright and license information, please refer to the LICENSE file,
* located at the package root folder.
*/
declare(strict_types=1);
namespace RateLimit\Options;
* @author Nikola Posa <[email protected]>
class RequestsPerWindowOptions implements OptionsInterface
{
* @var int
protected $limit;
protected $window;
* @var callable
protected $whitelist;
protected $limitExceededHandler;
public function __construct(int $limit, int $window, callable $whitelist, callable $limitExceededHandler)
$this->limit = $limit;
$this->window = $window;
$this->whitelist = $whitelist;
$this->limitExceededHandler = $limitExceededHandler;
}
public function getLimit() : int
return $this->limit;
public function getWindow() : int
return $this->window;
public function getWhitelist() : callable
return $this->whitelist;
public function getLimitExceededHandler() : callable
return $this->limitExceededHandler;