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 ( 055802...1917ae )
by
unknown
04:27
created

Lists::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
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
class Lists extends MailChimp implements ListsInterface
11
{
12
    /**
13
     * @var LoggerInterface
14
     */
15
    private $logger;
16
17
    /**
18
     * @param $api_key
19
     * @param LoggerInterface $logger
20
     *
21
     * @throws \Exception
22
     */
23
    public function __construct(
24
        $api_key,
25
        LoggerInterface $logger
26
    ) {
27
        parent::__construct($api_key);
28
29
        $this->logger = $logger;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function addMember(string $listId, array $data)
36
    {
37
        $response = $this->post('lists/' . $listId . '/members', $data);
38
39
        $this->logger->info('add_member: '.json_encode($response));
40
41
        return $response;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getMember(string $listId, string $hash)
48
    {
49
        $response = $this->get('lists/' . $listId . '/members/' . $hash);
50
51
        $this->logger->info('get_member: '.json_encode($response));
52
53
        return $response;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function updateMember(string $listId, string $hash, array $data)
60
    {
61
        $response = $this->patch('lists/' . $listId . '/members/' . $hash, $data);
62
63
        $this->logger->info('update_member: '.json_encode($response));
64
65
        return $response;
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71
    public function removeMember(string $listId, string $hash)
72
    {
73
        $response = $this->delete('lists/' . $listId . '/members/' . $hash);
74
75
        $this->logger->info('remove_member: '.json_encode($response));
76
77
        return $response;
78
    }
79
}
80