Issues (10)

src/Webhook.php (1 issue)

1
<?php
2
3
namespace Sebdesign\VivaPayments;
4
5
use Sebdesign\VivaPayments\Responses\WebhookVerificationKey;
6
7
class Webhook
8
{
9 3
    public function __construct(protected Client $client)
10
    {
11
    }
12
13
    /**
14
     * Get a webhook authorization code.
15
     *
16
     * @see https://developer.vivawallet.com/webhooks-for-payments/#generate-a-webhook-verification-key
17
     *
18
     * @param  array<string,mixed>  $guzzleOptions  Additional parameters for the Guzzle client
19
     */
20 6
    public function getVerificationKey(array $guzzleOptions = []): WebhookVerificationKey
21
    {
22 6
        $response = $this->client->get(
23 6
            $this->client->getUrl()->withPath('/api/messages/config/token'),
24 6
            array_merge_recursive(
25 6
                $this->client->authenticateWithBasicAuth(),
26
                $guzzleOptions
27
            )
28
        );
29
30
        /** @phpstan-ignore-next-line */
31 6
        return new WebhookVerificationKey(...$response);
0 ignored issues
show
$response is expanded, but the parameter $Key of Sebdesign\VivaPayments\R...ationKey::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
        return new WebhookVerificationKey(/** @scrutinizer ignore-type */ ...$response);
Loading history...
32
    }
33
}
34