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

UniformResourceIdentifier   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 4
dl 0
loc 58
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A fromChosenASN1() 0 3 1
A __construct() 0 4 1
A _choiceASN1() 0 3 1
A string() 0 3 1
A uri() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\GeneralName;
6
7
use Sop\ASN1\Type\Primitive\IA5String;
8
use Sop\ASN1\Type\Tagged\ImplicitlyTaggedType;
9
use Sop\ASN1\Type\TaggedType;
10
use Sop\ASN1\Type\UnspecifiedType;
11
12
/**
13
 * Implements <i>uniformResourceIdentifier</i> CHOICE type of
14
 * <i>GeneralName</i>.
15
 *
16
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.6
17
 */
18
class UniformResourceIdentifier extends GeneralName
19
{
20
    /**
21
     * URI.
22
     *
23
     * @var string
24
     */
25
    protected $_uri;
26
27
    /**
28
     * Constructor.
29
     *
30
     * @param string $uri
31
     */
32 62
    public function __construct(string $uri)
33
    {
34 62
        $this->_tag = self::TAG_URI;
35 62
        $this->_uri = $uri;
36 62
    }
37
38
    /**
39
     * {@inheritdoc}
40
     *
41
     * @return self
42
     */
43 34
    public static function fromChosenASN1(UnspecifiedType $el): GeneralName
44
    {
45 34
        return new self($el->asIA5String()->string());
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51 15
    public function string(): string
52
    {
53 15
        return $this->_uri;
54
    }
55
56
    /**
57
     * Get URI.
58
     *
59
     * @return string
60
     */
61 5
    public function uri(): string
62
    {
63 5
        return $this->_uri;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69 53
    protected function _choiceASN1(): TaggedType
70
    {
71 53
        return new ImplicitlyTaggedType($this->_tag, new IA5String($this->_uri));
72
    }
73
}
74