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.

Deferred::resolve()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Gandung\Promise;
4
5
/**
6
 * @author Paulus Gandung Prakosa <[email protected]>
7
 */
8
class Deferred implements PromisorInterface
9
{
10
    /**
11
     * @var PromiseInterface
12
     */
13
    private $promise;
14
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function promise()
19
    {
20
        if (null === $this->promise) {
21
            $this->promise = new Promise;
22
        }
23
24
        return $this->promise;
25
    }
26
27
    /**
28
     * Resolving promise with given value.
29
     *
30
     * @param mixed $value
31
     */
32
    public function resolve($value)
33
    {
34
        $this->promise()->resolve($value);
35
    }
36
37
    /**
38
     * Rejecting promise with given reason.
39
     *
40
     * @param mixed $reason
41
     */
42
    public function reject($reason)
43
    {
44
        $this->promise()->reject($reason);
45
    }
46
}
47