| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 5.4042 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | 1 | public function hasRequest(string $key): bool |
|
| 51 | { |
||
| 52 | 1 | if ($this->request === null) { |
|
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | try { |
||
| 57 | 1 | $contents = json_decode($this->request->getBody()->getContents(), true); |
|
| 58 | |||
| 59 | 1 | if ($contents === null) { |
|
| 60 | return false; |
||
| 61 | } |
||
| 62 | |||
| 63 | 1 | return Arr::has($contents, [$key]); |
|
| 64 | } catch (RuntimeException $exception) { |
||
| 65 | return false; |
||
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 82 |