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) |
||
60 | |||
61 | /** |
||
62 | * Process too many request. |
||
63 | * |
||
64 | * @param \Illuminate\Http\Request $request |
||
65 | * |
||
66 | * @return \Illuminate\Http\Response|mixed|null |
||
67 | */ |
||
68 | protected function processTooManyAttempts($request) |
||
85 | |||
86 | /** |
||
87 | * Exists in cache for current request. |
||
88 | * |
||
89 | * @param string $key |
||
90 | * @param \Illuminate\Http\Request $request |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | protected function existsInCacheForRequest($key, $request) |
||
98 | |||
99 | /** |
||
100 | * Rewrite hit for subclass cover. |
||
101 | * |
||
102 | * @param string $key |
||
103 | * @param int $decayMinutes |
||
104 | */ |
||
105 | protected function hit($key, $decayMinutes) |
||
109 | |||
110 | /** |
||
111 | * Build a Invalid Argument Exception. |
||
112 | * |
||
113 | * @return mixed |
||
114 | */ |
||
115 | protected function buildNeedAuthException() |
||
119 | |||
120 | /** |
||
121 | * Build response from not passed. |
||
122 | * |
||
123 | * @param Tencent007Response $response |
||
124 | * |
||
125 | * @return mixed |
||
126 | */ |
||
127 | protected function buildNotPassedResponse(Tencent007Response $response) |
||
131 | |||
132 | /** |
||
133 | * @param string $key |
||
134 | * @param int $hour |
||
135 | */ |
||
136 | protected function joinKeyToCache($key, $hour) |
||
144 | } |
||
145 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.