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.

Key   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 7

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A ttl() 0 3 1
A expired() 0 3 1
A __toString() 0 3 1
A identity() 0 3 1
A key() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\Bundle\ApiAuthBundle\Key;
6
7
final class Key
8
{
9
    private $key;
10
    private $identity;
11
    private $ttl;
12
13
    public function __construct(string $key, string $identity, int $ttl)
14
    {
15
        $this->key = $key;
16
        $this->identity = $identity;
17
        $this->ttl = $ttl > 0 ? $ttl : 0;
18
    }
19
20
    public function key(): string
21
    {
22
        return $this->key;
23
    }
24
25
    public function identity(): string
26
    {
27
        return $this->identity;
28
    }
29
30
    public function ttl(): int
31
    {
32
        return $this->ttl;
33
    }
34
35
    public function expired(): bool
36
    {
37
        return !$this->ttl();
38
    }
39
40
    public function __toString(): string
41
    {
42
        return $this->key;
43
    }
44
}
45