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 ( 588993...886570 )
by Cees-Jan
08:02
created

RepositoryHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiClients\Client\Scrutinizer\CommandBus\Handler\Github;
6
7
use ApiClients\Client\Scrutinizer\CommandBus\Command\Github\RepositoryCommand;
8
use ApiClients\Client\Scrutinizer\Resource\RepositoryInterface;
9
use ApiClients\Tools\Services\Client\FetchAndHydrateService;
10
use React\Promise\PromiseInterface;
11
12
final class RepositoryHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * @param FetchAndHydrateService $service
21
     */
22
    public function __construct(FetchAndHydrateService $service)
23
    {
24
        $this->service = $service;
25
    }
26
27
    /**
28
     * Fetch the given repository and hydrate it.
29
     *
30
     * @param  RepositoryCommand $command
31
     * @return PromiseInterface
32
     */
33
    public function handle(RepositoryCommand $command): PromiseInterface
34
    {
35
        return $this->service->fetch(
36
            'repositories/g/' . $command->getLogin() . '/' . $command->getName(),
37
            '',
38
            RepositoryInterface::HYDRATE_CLASS
39
        );
40
    }
41
}
42