| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | protected function handle(mixed ...$middlewareParams): HttpResponse|Request |
||
| 13 | { |
||
| 14 | $url = preg_replace("/^" . str_replace("/", "\/", Application::getAppConfig()->base_url) . "\//", "", $this->request->url); |
||
| 15 | |||
| 16 | if(!in_array($url, $middlewareParams["allow"])){ |
||
| 17 | if($this->check_request($middlewareParams)){ |
||
| 18 | return new RedirectResponse($middlewareParams["redirect"], htmx: false, parse: false); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | return $this->request; |
||
| 22 | } |
||
| 26 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.