GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 26a4ce...3b4693 )
by Freek
13:32 queued 04:57
created

WebhookCallEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 2
b 0
f 0
nc 1
nop 11
dl 0
loc 24
rs 9.9

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace Spatie\WebhookServer\Events;
4
5
use GuzzleHttp\Psr7\Response;
6
7
abstract class WebhookCallEvent
8
{
9
    public string $httpVerb;
10
11
    public string $webhookUrl;
12
13
    public array $payload;
14
15
    public array $headers;
16
17
    public array $meta;
18
19
    public array $tags;
20
21
    public int $attempt;
22
23
    public ?Response $response;
24
25
    public ?string $errorType;
26
27
    public ?string $errorMessage;
28
29
    public string $uuid;
30
31
    public function __construct(
32
        string $httpVerb,
33
        string $webhookUrl,
34
        array $payload,
35
        array $headers,
36
        array $meta,
37
        array $tags,
38
        int $attempt,
39
        ?Response $response,
40
        ?string $errorType,
41
        ?string $errorMessage,
42
        string $uuid
43
    ) {
44
        $this->httpVerb = $httpVerb;
45
        $this->webhookUrl = $webhookUrl;
46
        $this->payload = $payload;
47
        $this->headers = $headers;
48
        $this->meta = $meta;
49
        $this->tags = $tags;
50
        $this->attempt = $attempt;
51
        $this->response = $response;
52
        $this->errorType = $errorType;
53
        $this->errorMessage = $errorMessage;
54
        $this->uuid = $uuid;
55
    }
56
}
57