| 1 | <?php |
||
| 9 | class QuotaPolicy |
||
| 10 | { |
||
| 11 | /** @var int */ |
||
| 12 | protected $quota; |
||
| 13 | |||
| 14 | /** @var int */ |
||
| 15 | protected $interval; |
||
| 16 | |||
| 17 | final protected function __construct(int $quota, int $interval) |
||
| 25 | |||
| 26 | public static function perSecond(int $quota) |
||
| 30 | |||
| 31 | public static function perMinute(int $quota) |
||
| 35 | |||
| 36 | public static function perHour(int $quota) |
||
| 40 | |||
| 41 | public function getQuota(): int |
||
| 45 | |||
| 46 | public function getInterval(): int |
||
| 50 | } |
||
| 51 |