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 ( 557494...37b5aa )
by Cees-Jan
10s
created

Call   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 59
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getCallable() 0 4 1
A getArguments() 0 4 1
A resolve() 0 4 1
A reject() 0 4 1
A wait() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\Recoil;
4
5
use React\Promise\Deferred;
6
use React\Promise\PromiseInterface;
7
8
final class Call
9
{
10
    /**
11
     * @var callable
12
     */
13
    private $callable;
14
15
    /**
16
     * @var mixed[]
17
     */
18
    private $arguments;
19
20
    /**
21
     * @var Deferred
22
     */
23
    private $deferred;
24
25
    /**
26
     * @param callable $callable
27
     * @param mixed[]  $arguments
28
     */
29 4
    public function __construct(callable $callable, ...$arguments)
30
    {
31 4
        $this->callable = $callable;
32 4
        $this->arguments = $arguments;
33 4
        $this->deferred = new Deferred();
34 4
    }
35
36
    /**
37
     * @return callable
38
     */
39 2
    public function getCallable(): callable
40
    {
41 2
        return $this->callable;
42
    }
43
44
    /**
45
     * @return mixed[]
46
     */
47 2
    public function getArguments(): array
48
    {
49 2
        return $this->arguments;
50
    }
51
52 2
    public function resolve($value): void
53
    {
54 2
        $this->deferred->resolve($value);
55 2
    }
56
57 1
    public function reject($value): void
58
    {
59 1
        $this->deferred->reject($value);
60 1
    }
61
62 2
    public function wait(callable $onFulfilled = null, callable $onRejected = null): PromiseInterface
63
    {
64 2
        return $this->deferred->promise()->then($onFulfilled, $onRejected);
65
    }
66
}
67