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.

EDIPartyName   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 41
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A string() 0 3 1
A fromChosenASN1() 0 5 1
A _choiceASN1() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\GeneralName;
6
7
use Sop\ASN1\Type\Tagged\ImplicitlyTaggedType;
8
use Sop\ASN1\Type\TaggedType;
9
use Sop\ASN1\Type\UnspecifiedType;
10
11
/**
12
 * Implements *ediPartyName* CHOICE type of *GeneralName*.
13
 *
14
 * Currently acts as a parking object for decoding.
15
 *
16
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.6
17
 *
18
 * @todo Implement EDIPartyName type
19
 */
20
class EDIPartyName extends GeneralName
21
{
22
    /**
23
     * @var \Sop\ASN1\Element
24
     */
25
    protected $_element;
26
27
    /**
28
     * Constructor.
29
     */
30 2
    protected function __construct()
31
    {
32 2
        $this->_tag = self::TAG_EDI_PARTY_NAME;
33 2
    }
34
35
    /**
36
     * {@inheritdoc}
37
     *
38
     * @return self
39
     */
40 2
    public static function fromChosenASN1(UnspecifiedType $el): GeneralName
41
    {
42 2
        $obj = new self();
43 2
        $obj->_element = $el->asSequence();
44 2
        return $obj;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 1
    public function string(): string
51
    {
52 1
        return bin2hex($this->_element->toDER());
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58 1
    protected function _choiceASN1(): TaggedType
59
    {
60 1
        return new ImplicitlyTaggedType($this->_tag, $this->_element);
61
    }
62
}
63