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.
Passed
Push — master ( 307cce...27531d )
by Jamie
04:17 queued 15s
created

Token   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 3
c 3
b 0
f 1
lcom 1
cbo 2
dl 0
loc 36
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A populateFromResponse() 0 6 1
A hasExpired() 0 4 1
A getId() 0 4 1
1
<?php
2
3
namespace OpenStack\Identity\v2\Models;
4
5
use OpenStack\Common\Transport\Utils;
6
use Psr\Http\Message\ResponseInterface;
7
use OpenStack\Common\Resource\AbstractResource;
8
use OpenStack\Common\Resource\ValueResource;
9
10
/**
11
 * Represents an Identity v2 Token.
12
 *
13
 * @package OpenStack\Identity\v2\Models
14
 */
15
class Token extends AbstractResource implements \OpenStack\Common\Auth\Token
16
{
17
    /** @var \DateTimeImmutable */
18
    public $issuedAt;
19
20
    /** @var string */
21
    public $id;
22
23
    /** @var \DateTimeImmutable */
24
    public $expires;
25
26
    /** @var Tenant */
27
    public $tenant;
28
29
    protected $aliases = ['issued_at' => 'issuedAt'];
30
31
    /**
32
     * {@inheritDoc}
33
     */
34 2
    public function populateFromResponse(ResponseInterface $response)
35
    {
36 2
        $this->populateFromArray(Utils::jsonDecode($response)['access']['token']);
37
38 2
        return $this;
39
    }
40
41 1
    public function getId()
42
    {
43 1
        return $this->id;
44
    }
45
46 2
    public function hasExpired()
47
    {
48 2
        return $this->expires <= new \DateTimeImmutable('now', $this->expires->getTimezone());
49
    }
50
}
51