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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A promise() 0 8 2
A resolve() 0 4 1
A reject() 0 4 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