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::string()   A
last analyzed

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 0
crap 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