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 (#9)
by Cees-Jan
01:56
created

AbstractResource   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 75%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommandBus() 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\CommandBus;
6
use function Clue\React\Block\await;
7
use React\EventLoop\LoopInterface;
8
use React\Promise\PromiseInterface;
9
10
abstract class AbstractResource implements ResourceInterface
11
{
12
    /**
13
     * @var LoopInterface
14
     */
15
    private $loop;
16
17
    /**
18
     * @var CommandBus
19
     */
20
    private $commandBus;
21
22 4
    public function __construct(LoopInterface $loop, CommandBus $commandBus)
23
    {
24 4
        $this->loop = $loop;
25 4
        $this->commandBus = $commandBus;
26 4
    }
27
28
    /**
29
     * @return CommandBus
30
     */
31
    protected function getCommandBus()
32
    {
33
        return $this->commandBus;
34
    }
35
36 1
    protected function wait(PromiseInterface $promise)
37
    {
38 1
        return await($promise, $this->loop);
39
    }
40
}
41