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 ( b0e03a...4af0c2 )
by Tobias
02:50
created

GeocoderFulfilledPromise::getState()   A

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 0
1
<?php
2
3
/*
4
 * This file is part of the Geocoder package.
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @license    MIT License
9
 */
10
11
namespace Geocoder\Plugin\Promise;
12
13
use Geocoder\Collection;
14
use Geocoder\Exception\Exception;
15
use Http\Promise\Promise;
16
17
/**
18
 * @author Joel Wurtz <[email protected]>
19
 * @author Tobias Nyholm <[email protected]>
20
 */
21
final class GeocoderFulfilledPromise implements Promise
22
{
23
    /**
24
     * @var Collection
25
     */
26
    private $collection;
27
28
    /**
29
     * @param Collection $collection
30
     */
31
    public function __construct(Collection $collection)
32
    {
33
        $this->collection = $collection;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function then(callable $onFulfilled = null, callable $onRejected = null)
40
    {
41
        if (null === $onFulfilled) {
42
            return $this;
43
        }
44
45
        try {
46
            return new self($onFulfilled($this->collection));
47
        } catch (Exception $e) {
48
            return new GeocoderRejectedPromise($e);
49
        }
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getState()
56
    {
57
        return Promise::FULFILLED;
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function wait($unwrap = true)
64
    {
65
        if ($unwrap) {
66
            return $this->collection;
67
        }
68
    }
69
}
70