1 | <?php |
||
21 | class ThrottleRequests extends BaseThrottleRequests |
||
22 | { |
||
23 | /** |
||
24 | * Handle an incoming request. |
||
25 | * |
||
26 | * @param \Illuminate\Http\Request $request |
||
27 | * @param \Closure $next |
||
28 | * @param int|string $maxAttempts |
||
29 | * @param float|int $decayMinutes |
||
30 | * |
||
31 | * @return mixed |
||
32 | * |
||
33 | * @throws \Symfony\Component\HttpKernel\Exception\HttpException |
||
34 | */ |
||
35 | public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes = 1) |
||
72 | |||
73 | /** |
||
74 | * Rewrite hit for subclass cover. |
||
75 | * |
||
76 | * @param string $key |
||
77 | * @param int $decayMinutes |
||
78 | */ |
||
79 | protected function hit($key, $decayMinutes) |
||
83 | |||
84 | /** |
||
85 | * Build a Invalid Argument Exception. |
||
86 | * |
||
87 | * @return mixed |
||
88 | */ |
||
89 | protected function buildNeedAuthException() |
||
90 | { |
||
91 | throw new NeedCaptchaAuthException(); |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * Build response from not passed. |
||
96 | * |
||
97 | * @param Tencent007Response $response |
||
98 | * |
||
99 | * @return mixed |
||
100 | */ |
||
101 | protected function buildNotPassedResponse(Tencent007Response $response) |
||
107 | |||
108 | /** |
||
109 | * @param string $key |
||
110 | * @param int $hour |
||
111 | */ |
||
112 | protected function joinKeyToCache($key, $hour) |
||
120 | } |
||
121 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: