| 1 | <?php |
||
| 7 | class Rate |
||
| 8 | { |
||
| 9 | /** @var int */ |
||
| 10 | protected $operations; |
||
| 11 | |||
| 12 | /** @var int */ |
||
| 13 | protected $interval; |
||
| 14 | |||
| 15 | 10 | final protected function __construct(int $operations, int $interval) |
|
| 28 | |||
| 29 | 3 | public static function perSecond(int $operations) |
|
| 33 | |||
| 34 | 2 | public static function perMinute(int $operations) |
|
| 38 | |||
| 39 | 3 | public static function perHour(int $operations) |
|
| 43 | |||
| 44 | 1 | public static function perDay(int $operations) |
|
| 48 | |||
| 49 | 1 | public static function custom(int $operations, int $interval) |
|
| 53 | |||
| 54 | 10 | public function getOperations(): int |
|
| 58 | |||
| 59 | 10 | public function getInterval(): int |
|
| 63 | } |
||
| 64 |