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.

U2fRegistration::unserialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LM\AuthAbstractor\Implementation;
6
7
use LM\AuthAbstractor\Model\IU2fRegistration;
8
9
/**
10
 * Implementation of IU2fRegistration. Its strings are all encoded.
11
 */
12
class U2fRegistration implements IU2fRegistration
13
{
14
    /** @var string */
15
    private $attestationCertificate;
16
17
    /** @var int */
18
    private $counter;
19
20
    /** @var string */
21
    private $keyHandle;
22
23
    /** @var string */
24
    private $publicKey;
25
26
    /**
27
     * @param string $attestationCertificate The websafe-base64 encoding of the
28
     * attestation certificate of the U2F token.
29
     * @param int $counter The counter of the U2F token.
30
     * @param string $keyHandle The websafe-base64 encoding of the U2F
31
     * registration key handle.
32
     * @param string $publicKey The websafe-base64 encoding of the U2F
33
     * registration public key.
34
     */
35
    public function __construct(
36
        string $attestationCertificate,
37
        int $counter,
38
        string $keyHandle,
39
        string $publicKey
40
    ) {
41
        $this->attestationCertificate = $attestationCertificate;
42
        $this->counter = $counter;
43
        $this->keyHandle = $keyHandle;
44
        $this->publicKey = $publicKey;
45
    }
46
47
    public function getAttestationCertificate(): string
48
    {
49
        return $this->attestationCertificate;
50
    }
51
52
    public function getCounter(): int
53
    {
54
        return $this->counter;
55
    }
56
57
    public function getKeyHandle(): string
58
    {
59
        return $this->keyHandle;
60
    }
61
62
    public function getPublicKey(): string
63
    {
64
        return $this->publicKey;
65
    }
66
67
    public function serialize()
68
    {
69
        return serialize([
70
            $this->attestationCertificate,
71
            $this->counter,
72
            $this->keyHandle,
73
            $this->publicKey,
74
        ]);
75
    }
76
77
    public function unserialize($serialized)
78
    {
79
        list(
80
            $this->attestationCertificate,
81
            $this->counter,
82
            $this->keyHandle,
83
            $this->publicKey) = unserialize($serialized);
84
    }
85
}
86