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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 34
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sendRequest() 0 21 3
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