| Conditions | 4 |
| Paths | 6 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function process(Request $request, Handler $handler) : Response |
||
| 30 | { |
||
| 31 | $class = get_class($request); |
||
| 32 | $isValid = !array_key_exists($class, $this->blacklist); |
||
| 33 | if ($isValid) { |
||
| 34 | $isValid = !count($this->whitelist) || array_key_exists($class, $this->whitelist); |
||
| 35 | } |
||
| 36 | |||
| 37 | if (!$isValid) { |
||
| 38 | throw new Exception("Request $class is not allowed"); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $handler->handle($request); |
||
| 42 | } |
||
| 43 | |||
| 53 | } |