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.
Completed
Pull Request — master (#37)
by Dwight
08:34
created

FeedbackService::fetchFeedback()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\Apn;
4
5
use ZendService\Apple\Apns\Client\Feedback as Client;
6
7
class FeedbackService
8
{
9
    /**
10
     * The feedback client instance.
11
     *
12
     * @var \ZendService\Apple\Apns\Client\Feedback
13
     */
14
    protected $client;
15
16
    /**
17
     * Create feedback service instance.
18
     *
19
     * @param  \ZendService\Apple\Apns\Client\Feedback  $client
20
     */
21 1
    public function __construct(Client $client)
22
    {
23 1
        $this->client = $client;
24 1
    }
25
26
    /**
27
     * Get feedback from the Apple Feedback Service about failed deliveries.
28
     *
29
     * @return array|ApnFeedback[]
30
     * @throws Exceptions\ConnectionFailed
31
     */
32 1
    public function get()
33
    {
34 1
        $feedback = [];
35
36
        /** @var FeedbackResponse $response */
37 1
        foreach ($this->client->feedback() as $response) {
38 1
            $feedback[] = new ApnFeedback($response->getToken(), $response->getTime());
39
        }
40
41 1
        return $feedback;
42
    }
43
}
44