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 ( 9c2e1a...1f7860 )
by Cees-Jan
15:23 queued 12:04
created

LogglyLogger   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Test Coverage

Coverage 38.89%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 3
dl 0
loc 43
ccs 7
cts 18
cp 0.3889
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 6 1
A createFromHttpClient() 0 4 1
A send() 0 12 1
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\React\PSR3\Loggly;
4
5
use React\EventLoop\LoopInterface;
6
use React\HttpClient\Client;
7
8
final class LogglyLogger extends AbstractLogglyLogger
9
{
10
    /**
11
     * @var Client
12
     */
13
    private $httpClient;
14
15
    /**
16
     * @var string
17
     */
18
    private $token;
19
20 4
    private function __construct(Client $httpClient, string $token)
21
    {
22 4
        $this->httpClient = $httpClient;
23 4
        $this->token = $token;
24 4
    }
25
26 4
    public static function create(LoopInterface $loop, string $token): self
27
    {
28 4
        $httpClient = self::createHttpClient($loop);
29
30 4
        return new self($httpClient, $token);
31
    }
32
33
    public static function createFromHttpClient(Client $httpClient, string $token): self
34
    {
35
        return new self($httpClient, $token);
36
    }
37
38
    protected function send(string $data): void
39
    {
40
        $this->httpClient->request(
41
            'POST',
42
            'https://logs-01.loggly.com/inputs/' . $this->token,
43
            [
44
                'Content-Type' => 'application/json',
45
                'Content-Length' => \strlen($data),
46
            ],
47
            '1.1'
48
        )->end($data);
49
    }
50
}
51