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.

Lock::getToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace RemiSan\Lock;
4
5
final class Lock
6
{
7
    /** @var string */
8
    private $resource;
9
10
    /** @var string */
11
    private $token;
12
13
    /** @var int */
14
    private $validityEndTime;
15
16
    /**
17
     * Lock constructor.
18
     *
19
     * @param string $resource The name of the resource to lock
20
     * @param string $token    The token generated by the Locker
21
     */
22 72
    public function __construct($resource, $token)
23
    {
24 72
        $this->resource = (string) $resource;
25 72
        $this->token = (string) $token;
26 72
        $this->validityEndTime = null;
27 72
    }
28
29
    /**
30
     * Get the resource name.
31
     *
32
     * @return string
33
     */
34 63
    public function getResource()
35
    {
36 63
        return $this->resource;
37
    }
38
39
    /**
40
     * Get the token associated with the lock.
41
     *
42
     * @return string
43
     */
44 57
    public function getToken()
45
    {
46 57
        return $this->token;
47
    }
48
49
    /**
50
     * Set the validity end time (in milliseconds since EPOCH).
51
     *
52
     * @param int $validityEndTime
53
     */
54 9
    public function setValidityEndTime($validityEndTime)
55
    {
56 9
        $this->validityEndTime = (int) $validityEndTime;
57 9
    }
58
59
    /**
60
     * Get the validity end time (in milliseconds since EPOCH).
61
     *
62
     * @return int
63
     */
64 18
    public function getValidityEndTime()
65
    {
66 18
        return $this->validityEndTime;
67
    }
68
}
69