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

TargetName   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

5 Methods

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