| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function __invoke(Request $request) |
||
| 24 | { |
||
| 25 | $payload = $request->input(); |
||
| 26 | $modelClass = config('gocardless.webhooks.model'); |
||
| 27 | |||
| 28 | foreach ($payload['events'] as $event) { |
||
| 29 | $gocardlessWebhookCall = $modelClass::create([ |
||
| 30 | 'resource_type' => $event['resource_type'] ?? '', |
||
| 31 | 'action' => $event['action'] ?? '', |
||
| 32 | 'payload' => $event, |
||
| 33 | ]); |
||
| 34 | |||
| 35 | try { |
||
| 36 | $gocardlessWebhookCall->process(); |
||
| 37 | } catch (Exception $exception) { |
||
| 38 | $gocardlessWebhookCall->saveException($exception); |
||
| 39 | //Improve the way we handle the exceptions here, add the option to notify the exceptions. |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | return response()->json(['message' => 'ok']); |
||
| 44 | } |
||
| 45 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths