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.

TargetGroup   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 8
dl 0
loc 54
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 __construct() 0 4 1
A name() 0 3 1
A toASN1() 0 3 1
A fromChosenASN1() 0 3 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 'targetGroup' CHOICE of the *Target* ASN.1 type.
14
 *
15
 * @see https://tools.ietf.org/html/rfc5755#section-4.3.2
16
 */
17
class TargetGroup extends Target
18
{
19
    /**
20
     * Group name.
21
     *
22
     * @var GeneralName
23
     */
24
    protected $_name;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param GeneralName $name
30
     */
31 6
    public function __construct(GeneralName $name)
32
    {
33 6
        $this->_name = $name;
34 6
        $this->_type = self::TYPE_GROUP;
35 6
    }
36
37
    /**
38
     * {@inheritdoc}
39
     *
40
     * @return self
41
     */
42 3
    public static function fromChosenASN1(TaggedType $el): Target
43
    {
44 3
        return new self(GeneralName::fromASN1($el));
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 2
    public function string(): string
51
    {
52 2
        return $this->_name->string();
53
    }
54
55
    /**
56
     * Get group 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 3
    public function toASN1(): Element
69
    {
70 3
        return new ExplicitlyTaggedType($this->_type, $this->_name->toASN1());
71
    }
72
}
73