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 ( 78c5cf...93608b )
by Cees-Jan
07:34 queued 05:28
created

OutstandingCall::progress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 9.4286
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
3
namespace WyriHaximus\React\ChildProcess\Messenger;
4
5
use React\Promise\Deferred;
6
7
class OutstandingCall
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $uniqid;
13
14
    /**
15
     * @var Deferred
16
     */
17
    protected $deferred;
18
19
    /**
20
     * @var callable
21
     */
22
    protected $cleanup;
23
24
    /**
25
     * @param string $uniqid
26
     * @param callable $canceller
27
     */
28 4
    public function __construct($uniqid, callable $canceller = null, callable $cleanup = null)
29
    {
30 4
        if ($canceller !== null) {
31 3
            $canceller = \Closure::bind($canceller, $this, 'WyriHaximus\React\ChildProcess\Messenger\OutstandingCall');
32
        }
33
34 4
        $this->uniqid = $uniqid;
35 4
        $this->deferred = new Deferred($canceller);
36
37 4
        if (!is_callable($cleanup)) {
38 1
            $cleanup = function () {
39 1
            };
40
        }
41 4
        $this->cleanup = $cleanup;
42 4
    }
43
44
    /**
45
     * @return mixed
46
     */
47 4
    public function getUniqid()
48
    {
49 4
        return $this->uniqid;
50
    }
51
52
    /**
53
     * @return Deferred
54
     */
55 3
    public function getDeferred()
56
    {
57 3
        return $this->deferred;
58
    }
59
60
    /**
61
     * @param mixed $value
62
     */
63 1
    public function resolve($value)
64
    {
65 1
        $cleanup = $this->cleanup;
66 1
        $cleanup($this);
67 1
        return $this->deferred->resolve($value);
68
    }
69
70
    /**
71
     * @param mixed $value
72
     */
73
    public function progress($value)
74
    {
75
        $cleanup = $this->cleanup;
76
        $cleanup($this);
77
        return $this->deferred->progress($value);
0 ignored issues
show
Deprecated Code introduced by
The method React\Promise\Deferred::progress() has been deprecated with message: 2.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
78
    }
79
80
    /**
81
     * @param mixed $value
82
     */
83
    public function reject($value)
84
    {
85
        $cleanup = $this->cleanup;
86
        $cleanup($this);
87
        return $this->deferred->reject($value);
88
    }
89
}
90