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.

CommunityHealthHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 34
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 13 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Github\CommandBus\Handler\Repository;
4
5
use ApiClients\Client\Github\AcceptHeader;
6
use ApiClients\Client\Github\CommandBus\Command\Repository\CommunityHealthCommand;
7
use ApiClients\Client\Github\Resource\Repository\CommunityHealthInterface;
8
use ApiClients\Foundation\Transport\Options as TransportOptions;
9
use ApiClients\Tools\Services\Client\FetchAndHydrateService;
10
use React\Promise\PromiseInterface;
11
12
final class CommunityHealthHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * CommunityHealthHandler constructor.
21
     * @param FetchAndHydrateService $service
22
     */
23 1
    public function __construct(FetchAndHydrateService $service)
24
    {
25 1
        $this->service = $service;
26 1
    }
27
28
    /**
29
     * @param  CommunityHealthCommand $command
30
     * @return PromiseInterface
31
     */
32 1
    public function handle(CommunityHealthCommand $command): PromiseInterface
33
    {
34 1
        return $this->service->fetch(
35 1
            'repos/' . $command->getFullName() . '/community/profile',
36 1
            '',
37 1
            CommunityHealthInterface::HYDRATE_CLASS,
38
            [
39
                TransportOptions::HEADERS => [
40 1
                    'Accept' => AcceptHeader::getHeader(AcceptHeader::PRESET_COMMUNITY_HEALTH),
41
                ],
42
            ]
43
        );
44
    }
45
}
46