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 ( c42cfc...29c08b )
by Casper
04:31 queued 02:06
created

PushLogClient::storePushLog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 9
dl 0
loc 22
ccs 0
cts 11
cp 0
crap 2
rs 9.9
c 0
b 0
f 0

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 NStack\Clients;
4
5
/**
6
 * Class PushLogClient
7
 *
8
 * @package NStack\Clients
9
 * @author  Tiago Araujo <[email protected]>
10
 */
11
class PushLogClient extends NStackClient
12
{
13
    /** @var string */
14
    protected $path = 'ugc';
15
16
    /**
17
     * storePushLog
18
     *
19
     * @param String      $provider
20
     * @param String      $key
21
     * @param String      $type
22
     * @param bool        $succeeded
23
     * @param String|null $request
24
     * @param String|null $response
25
     * @param int|null    $userId
26
     * @param String|null $relationType
27
     * @param int|null    $relationId
28
     */
29
    public function storePushLog(
30
        String $provider,
31
        String $key,
32
        String $type,
33
        bool $succeeded,
34
        String $request = null,
35
        String $response = null,
36
        int $userId = null,
37
        String $relationType = null,
38
        int $relationId = null
39
    ) {
40
        $this->client->post($this->buildPath($this->path), [
41
            'body' => '{
42
                            "provider": "' . $provider . '",
43
                            "key": "' . $key . '",
44
                            "type": "' . $type . '",
45
                            "succeeded": ' . $succeeded . ',
46
                            "request": { ' . $request . ', },
47
                            "response": { ' . $response . ', },
48
                            "user_id": ' . $userId . '
49
                            "relation_type": "' . $relationType . '",
50
                            "relation_id": ' . $relationId . '
51
                        }',
52
        ]);
53
    }
54
}