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.

AccountLinking   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 51
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getStatus() 0 4 1
A getAuthorizationCode() 0 4 1
A create() 0 5 2
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Callback;
4
5
class AccountLinking
6
{
7
    const STATUS_LINKED = 'linked';
8
    const STATUS_UNLINKED = 'unlinked';
9
    /**
10
     * @var string
11
     */
12
    private $status;
13
14
    /**
15
     * @var null|string
16
     */
17
    private $authorizationCode;
18
19
    /**
20
     * @param string $status
21
     * @param null|string $authorizationCode
22
     */
23 5
    public function __construct($status, $authorizationCode = null)
24
    {
25 5
        $this->status = $status;
26 5
        $this->authorizationCode = $authorizationCode;
27 5
    }
28
29
    /**
30
     * @return string
31
     */
32 1
    public function getStatus()
33
    {
34 1
        return $this->status;
35
    }
36
37
    /**
38
     * @return null|string
39
     */
40 2
    public function getAuthorizationCode()
41
    {
42 2
        return $this->authorizationCode;
43
    }
44
45
    /**
46
     * @param array $payload
47
     *
48
     * @return static
49
     */
50 1
    public static function create(array $payload)
51
    {
52 1
        $authorizationCode = isset($payload['authorization_code']) ? $payload['authorization_code'] : null;
53 1
        return new static($payload['status'], $authorizationCode);
54
    }
55
}
56