1 | <?php |
||
12 | class RateLimit extends ConfigurationAnnotation |
||
13 | { |
||
14 | /** |
||
15 | * @var array HTTP Methods protected by this annotation. Defaults to all method |
||
16 | */ |
||
17 | protected $methods = array(); |
||
18 | |||
19 | /** |
||
20 | * @var int Number of calls per period |
||
21 | */ |
||
22 | protected $limit = -1; |
||
23 | |||
24 | /** |
||
25 | * @var int Number of seconds of the time period in which the calls can be made |
||
26 | */ |
||
27 | protected $period = 3600; |
||
28 | |||
29 | /** |
||
30 | * @var mixed Generic payload |
||
31 | */ |
||
32 | protected $payload; |
||
33 | |||
34 | /** |
||
35 | * Returns the alias name for an annotated configuration. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | 1 | public function getAliasName() |
|
43 | |||
44 | /** |
||
45 | * Returns whether multiple annotations of this type are allowed |
||
46 | * |
||
47 | * @return Boolean |
||
48 | */ |
||
49 | 1 | public function allowArray() |
|
53 | |||
54 | /** |
||
55 | * @return int |
||
56 | */ |
||
57 | 16 | public function getLimit() |
|
61 | |||
62 | /** |
||
63 | * @param int $limit |
||
64 | */ |
||
65 | 23 | public function setLimit($limit) |
|
69 | |||
70 | /** |
||
71 | * @return array |
||
72 | */ |
||
73 | 24 | public function getMethods() |
|
77 | |||
78 | /** |
||
79 | * @param array $methods |
||
80 | */ |
||
81 | 13 | public function setMethods($methods) |
|
85 | |||
86 | /** |
||
87 | * @return int |
||
88 | */ |
||
89 | 16 | public function getPeriod() |
|
93 | |||
94 | /** |
||
95 | * @param int $period |
||
96 | */ |
||
97 | 23 | public function setPeriod($period) |
|
101 | |||
102 | /** |
||
103 | * @return mixed |
||
104 | */ |
||
105 | 10 | public function getPayload() |
|
109 | |||
110 | /** |
||
111 | * @param mixed $payload |
||
112 | */ |
||
113 | 2 | public function setPayload($payload) |
|
117 | |||
118 | } |
||
119 |