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 ( f101b8...b6f9bf )
by Cees-Jan
07:07
created

AbstractResource::handleCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Foundation\Resource;
4
5
use ApiClients\Tools\CommandBus\CommandBus;
6
use function Clue\React\Block\await;
7
use React\EventLoop\LoopInterface;
8
use React\Promise\PromiseInterface;
9
use React\Promise\CancellablePromiseInterface;
10
11
abstract class AbstractResource implements ResourceInterface
12
{
13
    /**
14
     * @var LoopInterface
15
     */
16
    private $loop;
17
18
    /**
19
     * @var CommandBus
20
     */
21
    private $commandBus;
22 4
23
    public function __construct(LoopInterface $loop, CommandBus $commandBus)
24 4
    {
25 4
        $this->loop = $loop;
26 4
        $this->commandBus = $commandBus;
27
    }
28
29
    /**
30
     * @param $command
31
     * @return CancellablePromiseInterface
32
     */
33
    protected function handleCommand($command): CancellablePromiseInterface
34
    {
35
        return $this->commandBus->handle($command);
36 1
    }
37
38 1
    protected function wait(PromiseInterface $promise)
39
    {
40
        return await($promise, $this->loop);
41
    }
42
}
43