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.
Completed
Branch php72 (a7f01e)
by Joni
04:53
created

UniqueIdentifier::string()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\Certificate;
6
7
use Sop\ASN1\Type\Primitive\BitString;
8
9
/**
10
 * Implements <i>UniqueIdentifier</i> ASN.1 type.
11
 *
12
 * @see https://tools.ietf.org/html/rfc5280#section-4.1.2.8
13
 */
14
class UniqueIdentifier
15
{
16
    /**
17
     * Identifier.
18
     *
19
     * @var BitString
20
     */
21
    protected $_uid;
22
23
    /**
24
     * Constructor.
25
     *
26
     * @param BitString $bs
27
     */
28 16
    public function __construct(BitString $bs)
29
    {
30 16
        $this->_uid = $bs;
31 16
    }
32
33
    /**
34
     * Initialize from ASN.1.
35
     *
36
     * @param BitString $bs
37
     *
38
     * @return self
39
     */
40 4
    public static function fromASN1(BitString $bs): UniqueIdentifier
41
    {
42 4
        return new self($bs);
43
    }
44
45
    /**
46
     * Initialize from string.
47
     *
48
     * @param string $str
49
     *
50
     * @return self
51
     */
52 12
    public static function fromString(string $str): UniqueIdentifier
53
    {
54 12
        return new self(new BitString($str));
55
    }
56
57
    /**
58
     * Get unique identifier as a string.
59
     *
60
     * @return string
61
     */
62 6
    public function string(): string
63
    {
64 6
        return $this->_uid->string();
65
    }
66
67
    /**
68
     * Get unique identifier as a bit string.
69
     *
70
     * @return BitString
71
     */
72 1
    public function bitString(): BitString
73
    {
74 1
        return $this->_uid;
75
    }
76
77
    /**
78
     * Get ASN.1 element.
79
     *
80
     * @return BitString
81
     */
82 12
    public function toASN1(): BitString
83
    {
84 12
        return $this->_uid;
85
    }
86
}
87