| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function handleWebhook(Request $request) |
||
| 18 | { |
||
| 19 | $payload = json_decode($request->payload, true); |
||
| 20 | |||
| 21 | $method = 'handle'.studly_case(str_replace('.', '_', $payload['event'])); |
||
| 22 | |||
| 23 | if (method_exists($this, $method)) { |
||
| 24 | return $this->{$method}($payload); |
||
| 25 | } else { |
||
| 26 | return abort(501, "Not Implemented"); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 70 |