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

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 5
c 3
b 1
f 1
lcom 0
cbo 0
dl 0
loc 64
ccs 14
cts 14
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getResource() 0 4 1
A getToken() 0 4 1
A setValidityEndTime() 0 4 1
A getValidityEndTime() 0 4 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