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

IssuerAlternativeNameExtension   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A names() 0 3 1
A _valueASN1() 0 3 1
A _fromDER() 0 5 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\Certificate\Extension;
6
7
use Sop\ASN1\Element;
8
use Sop\ASN1\Type\UnspecifiedType;
9
use Sop\X509\GeneralName\GeneralNames;
10
11
/**
12
 * Implements 'Issuer Alternative Name' certificate extension.
13
 *
14
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.7
15
 */
16
class IssuerAlternativeNameExtension extends Extension
17
{
18
    /**
19
     * Names.
20
     *
21
     * @var GeneralNames
22
     */
23
    protected $_names;
24
25
    /**
26
     * Constructor.
27
     *
28
     * @param bool         $critical
29
     * @param GeneralNames $names
30
     */
31 10
    public function __construct(bool $critical, GeneralNames $names)
32
    {
33 10
        parent::__construct(self::OID_ISSUER_ALT_NAME, $critical);
34 10
        $this->_names = $names;
35 10
    }
36
37
    /**
38
     * Get names.
39
     *
40
     * @return GeneralNames
41
     */
42 2
    public function names(): GeneralNames
43
    {
44 2
        return $this->_names;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 9
    protected static function _fromDER(string $data, bool $critical): Extension
51
    {
52 9
        return new self($critical,
53 9
            GeneralNames::fromASN1(
54 9
                UnspecifiedType::fromDER($data)->asSequence()));
55
    }
56
57
    /**
58
     * {@inheritdoc}
59
     */
60 15
    protected function _valueASN1(): Element
61
    {
62 15
        return $this->_names->toASN1();
63
    }
64
}
65