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
06:57
created

Call::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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 implements PromiseInterface
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
    public function __construct(callable $callable, ...$arguments)
30
    {
31
        $this->callable = $callable;
32
        $this->arguments = $arguments;
33
        $this->deferred = new Deferred();
34
    }
35
    /**
36
     * @return callable
37
     */
38
    public function getCallable(): callable
39
    {
40
        return $this->callable;
41
    }
42
43
    /**
44
     * @return mixed[]
45
     */
46
    public function getArguments(): array
47
    {
48
        return $this->arguments;
49
    }
50
51
    public function resolve($value): void
52
    {
53
        $this->deferred->resolve($value);
54
    }
55
56
    public function reject($value): void
57
    {
58
        $this->deferred->reject($value);
59
    }
60
61
    public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null): PromiseInterface
62
    {
63
        return $this->deferred->promise()->then($onFulfilled, $onRejected, $onProgress);
64
    }
65
}
66