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::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 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