1 | <?php |
||
22 | trait RateLimitTrait { |
||
23 | |||
24 | /** |
||
25 | * Limit. |
||
26 | * |
||
27 | * @var int|null |
||
28 | */ |
||
29 | private $limit; |
||
30 | |||
31 | /** |
||
32 | * Remaining. |
||
33 | * |
||
34 | * @var int|null |
||
35 | */ |
||
36 | private $remaining; |
||
37 | |||
38 | /** |
||
39 | * Reset. |
||
40 | * |
||
41 | * @var DateTime|null |
||
42 | */ |
||
43 | private $reset; |
||
44 | |||
45 | /** |
||
46 | * Get the limit. |
||
47 | * |
||
48 | * @return int|null Returns the limit. |
||
49 | */ |
||
50 | public function getLimit(): ?int { |
||
53 | |||
54 | /** |
||
55 | * Get the remaining. |
||
56 | * |
||
57 | * @return int|null Returns the remaining. |
||
58 | */ |
||
59 | public function getRemaining(): ?int { |
||
62 | |||
63 | /** |
||
64 | * Get the reset. |
||
65 | * |
||
66 | * @return DateTime|null Returns reset. |
||
67 | */ |
||
68 | public function getReset(): ?DateTime { |
||
71 | |||
72 | /** |
||
73 | * Set the limit. |
||
74 | * |
||
75 | * @param int|null $limit The limit. |
||
76 | * @return self Returns this instance. |
||
77 | */ |
||
78 | public function setLimit(?int $limit): self { |
||
82 | |||
83 | /** |
||
84 | * Set the remaining. |
||
85 | * |
||
86 | * @param int|null $remaining The remaining. |
||
87 | * @return self Returns this instance. |
||
88 | */ |
||
89 | public function setRemaining(?int $remaining): self { |
||
93 | |||
94 | /** |
||
95 | * Set the reset. |
||
96 | * |
||
97 | * @param DateTime|null $reset The reset. |
||
98 | * @return self Returns this instance. |
||
99 | */ |
||
100 | public function setReset(?DateTime $reset): self { |
||
104 | } |
||
105 |