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
Pull Request — master (#1)
by Cees-Jan
03:12
created

CommitsHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Travis\CommandBus\Handler;
4
5
use ApiClients\Client\Travis\CommandBus\Command\CommitsCommand;
6
use ApiClients\Client\Travis\Resource\CommitInterface;
7
use ApiClients\Tools\Services\Client\FetchAndHydrateService;
8
use ApiClients\Tools\Services\Client\FetchAndIterateService;
9
use React\Promise\PromiseInterface;
10
use function React\Promise\resolve;
11
use function WyriHaximus\React\futureFunctionPromise;
12
13
final class CommitsHandler
14
{
15
    /**
16
     * @var FetchAndHydrateService
17
     */
18
    private $service;
19
20
    /**
21
     * @param FetchAndIterateService $service
22
     */
23 1
    public function __construct(FetchAndIterateService $service)
24
    {
25 1
        $this->service = $service;
0 ignored issues
show
Documentation Bug introduced by
It seems like $service of type object<ApiClients\Tools\...FetchAndIterateService> is incompatible with the declared type object<ApiClients\Tools\...FetchAndHydrateService> of property $service.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
26 1
    }
27
28
    /**
29
     * Fetch the given repository and hydrate it
30
     *
31
     * @param CommitsCommand $command
32
     * @return PromiseInterface
33
     */
34 1
    public function handle(CommitsCommand $command): PromiseInterface
35
    {
36 1
        return $this->service->handle(
37 1
            'repos/' . $command->getRepository() . '/builds',
38 1
            'commits',
39 1
            CommitInterface::HYDRATE_CLASS
40
        );
41
    }
42
}
43