| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function __invoke(Request $request, string $configKey = null) |
||
| 14 | { |
||
| 15 | $webhookConfig = new WebhookConfig([ |
||
| 16 | 'name' => 'stripe', |
||
| 17 | 'signing_secret' => ($configKey) ? |
||
| 18 | config('stripe-webhooks.signing_secret_'.$configKey) : |
||
| 19 | config('stripe-webhooks.signing_secret'), |
||
| 20 | 'signature_header_name' => 'Stripe-Signature', |
||
| 21 | 'signature_validator' => StripeSignatureValidator::class, |
||
| 22 | 'webhook_profile' => ProcessEverythingWebhookProfile::class, |
||
| 23 | 'webhook_model' => WebhookCall::class, |
||
| 24 | 'process_webhook_job' => config('stripe-webhooks.model'), |
||
| 25 | ]); |
||
| 26 | |||
| 27 | (new WebhookProcessor($request, $webhookConfig))->process(); |
||
| 28 | |||
| 29 | return response()->json(['message' => 'ok']); |
||
|
|
|||
| 30 | } |
||
| 31 | } |
||
| 32 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: