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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 46
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A uri() 0 3 1
A _qualifierASN1() 0 3 1
A fromQualifierASN1() 0 3 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