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.

CPSQualifier::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\Certificate\Extension\CertificatePolicy;
6
7
use Sop\ASN1\Element;
8
use Sop\ASN1\Type\Primitive\IA5String;
9
use Sop\ASN1\Type\UnspecifiedType;
10
11
/**
12
 * Implements *CPSuri* ASN.1 type used by 'Certificate Policies'
13
 * certificate extension.
14
 *
15
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.4
16
 */
17
class CPSQualifier extends PolicyQualifierInfo
18
{
19
    /**
20
     * URI.
21
     *
22
     * @var string
23
     */
24
    protected $_uri;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param string $uri
30
     */
31 16
    public function __construct(string $uri)
32
    {
33 16
        $this->_oid = self::OID_CPS;
34 16
        $this->_uri = $uri;
35 16
    }
36
37
    /**
38
     * {@inheritdoc}
39
     *
40
     * @return self
41
     */
42 12
    public static function fromQualifierASN1(UnspecifiedType $el): PolicyQualifierInfo
43
    {
44 12
        return new self($el->asString()->string());
45
    }
46
47
    /**
48
     * Get URI.
49
     *
50
     * @return string
51
     */
52 3
    public function uri(): string
53
    {
54 3
        return $this->_uri;
55
    }
56
57
    /**
58
     * {@inheritdoc}
59
     */
60 18
    protected function _qualifierASN1(): Element
61
    {
62 18
        return new IA5String($this->_uri);
63
    }
64
}
65