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.

SubjectKeyIdentifierExtension   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A _valueASN1() 0 3 1
A __construct() 0 4 1
A _fromDER() 0 4 1
A keyIdentifier() 0 3 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\Primitive\OctetString;
9
use Sop\ASN1\Type\UnspecifiedType;
10
11
/**
12
 * Implements 'Subject Key Identifier' certificate extension.
13
 *
14
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.2
15
 */
16
class SubjectKeyIdentifierExtension extends Extension
17
{
18
    /**
19
     * Key identifier.
20
     *
21
     * @var string
22
     */
23
    protected $_keyIdentifier;
24
25
    /**
26
     * Constructor.
27
     *
28
     * @param bool   $critical
29
     * @param string $keyIdentifier
30
     */
31 19
    public function __construct(bool $critical, string $keyIdentifier)
32
    {
33 19
        parent::__construct(self::OID_SUBJECT_KEY_IDENTIFIER, $critical);
34 19
        $this->_keyIdentifier = $keyIdentifier;
35 19
    }
36
37
    /**
38
     * Get key identifier.
39
     *
40
     * @return string
41
     */
42 14
    public function keyIdentifier(): string
43
    {
44 14
        return $this->_keyIdentifier;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 16
    protected static function _fromDER(string $data, bool $critical): Extension
51
    {
52 16
        return new self($critical,
53 16
            UnspecifiedType::fromDER($data)->asOctetString()->string());
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59 23
    protected function _valueASN1(): Element
60
    {
61 23
        return new OctetString($this->_keyIdentifier);
62
    }
63
}
64