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.
Test Failed
Push — master ( 405cf3...79c9ba )
by Joni
04:48
created

DNSName::fromChosenASN1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
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\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 *dNSName* CHOICE type of *GeneralName*.
14
 *
15
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.6
16
 */
17
class DNSName extends GeneralName
18
{
19
    /**
20
     * DNS name.
21
     *
22
     * @var string
23
     */
24
    protected $_name;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param string $name Domain name
30
     */
31 26
    public function __construct(string $name)
32
    {
33 26
        $this->_tag = self::TAG_DNS_NAME;
34 26
        $this->_name = $name;
35 26
    }
36
37
    /**
38
     * {@inheritdoc}
39
     *
40
     * @return self
41
     */
42 13
    public static function fromChosenASN1(UnspecifiedType $el): GeneralName
43
    {
44 13
        return new self($el->asIA5String()->string());
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function string(): string
51 3
    {
52
        return $this->_name;
53 3
    }
54
55
    /**
56
     * Get DNS name.
57
     *
58
     * @return string
59
     */
60
    public function name(): string
61 4
    {
62
        return $this->_name;
63 4
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    protected function _choiceASN1(): TaggedType
69
    {
70 24
        return new ImplicitlyTaggedType($this->_tag, new IA5String($this->_name));
71
    }
72
}
73