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.

Lists::updateMember()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusMailchimpPlugin\Api;
6
7
use DrewM\MailChimp\MailChimp;
8
use Psr\Log\LoggerInterface;
9
10
final class Lists extends MailChimp implements ListsInterface
11
{
12
    /** @var LoggerInterface */
13
    private $logger;
14
15
    public function __construct(
16
        $api_key,
17
        LoggerInterface $logger
18
    ) {
19
        parent::__construct($api_key);
20
21
        $this->logger = $logger;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function addMember(string $listId, array $data)
28
    {
29
        $response = $this->post('lists/' . $listId . '/members', $data);
30
31
        $this->logger->info('add_member: '.json_encode($response));
32
33
        return $response;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getMember(string $listId, string $hash)
40
    {
41
        $response = $this->get('lists/' . $listId . '/members/' . $hash);
42
43
        $this->logger->info('get_member: '.json_encode($response));
44
45
        return $response;
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function updateMember(string $listId, string $hash, array $data)
52
    {
53
        $response = $this->patch('lists/' . $listId . '/members/' . $hash, $data);
54
55
        $this->logger->info('update_member: '.json_encode($response));
56
57
        return $response;
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function removeMember(string $listId, string $hash)
64
    {
65
        $response = $this->delete('lists/' . $listId . '/members/' . $hash);
66
67
        $this->logger->info('remove_member: '.json_encode($response));
68
69
        return $response;
70
    }
71
}
72