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.

AbstractResource   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handleCommand() 0 4 1
A wait() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Foundation\Resource;
4
5
use ApiClients\Tools\CommandBus\CommandBusInterface;
6
use function Clue\React\Block\await;
7
use React\EventLoop\LoopInterface;
8
use React\Promise\CancellablePromiseInterface;
9
use React\Promise\PromiseInterface;
10
11
abstract class AbstractResource implements ResourceInterface
12
{
13
    /**
14
     * @var LoopInterface
15
     */
16
    private $loop;
17
18
    /**
19
     * @var CommandBusInterface
20
     */
21
    private $commandBus;
22
23 5
    public function __construct(LoopInterface $loop, CommandBusInterface $commandBus)
24
    {
25 5
        $this->loop = $loop;
26 5
        $this->commandBus = $commandBus;
27 5
    }
28
29
    /**
30
     * @param $command
31
     * @return CancellablePromiseInterface
32
     */
33 1
    protected function handleCommand($command): CancellablePromiseInterface
34
    {
35 1
        return $this->commandBus->handle($command);
36
    }
37
38 1
    protected function wait(PromiseInterface $promise)
39
    {
40 1
        return await($promise, $this->loop);
41
    }
42
}
43