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
Push — master ( d88fce...019e6b )
by Alexander
03:10
created

ServiceFeedbackClient::sendRequest()   A

Complexity

Conditions 3
Paths 5

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
rs 9.3142
cc 3
eloc 12
nc 5
nop 0
1
<?php
2
3
/*
4
 * (c) Alexander Zhukov <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Zbox\UnifiedPush\NotificationService\APNS;
11
12
use Zbox\UnifiedPush\Exception\ClientException;
13
14
/**
15
 * Class ServiceFeedbackClient
16
 * @package Zbox\UnifiedPush\NotificationService\APNS
17
 */
18
class ServiceFeedbackClient extends ServiceClient
19
{
20
    /**
21
     * APN Feedback service give you information about failed push notifications
22
     *
23
     * @param array|null $notification
24
     * @throws ClientException
25
     * @return bool
26
     */
27
    /**
28
     * @return \ArrayIterator
29
     */
30
    public function sendRequest()
31
    {
32
        try {
33
            $connection    = $this->getClientConnection();
34
            $feedbackData  = $connection->read(-1);
35
            $connection->disconnect();
36
37
        } catch (\Exception $e) {
38
            throw new ClientException($e->getMessage());
39
        }
40
41
        $invalidRecipients = new \ArrayIterator();
42
43
        foreach (str_split($feedbackData, 38) as $item)
44
        {
45
            $deviceData = unpack('N1timestamp/n1length/H*token', $item);
46
            $invalidRecipients->append($deviceData['token']);
47
        }
48
49
        return $invalidRecipients;
50
    }
51
}
52