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.

EOC::__construct()   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
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\ASN1\Type\Primitive;
6
7
use Sop\ASN1\Component\Identifier;
8
use Sop\ASN1\Component\Length;
9
use Sop\ASN1\Element;
10
use Sop\ASN1\Exception\DecodeException;
11
use Sop\ASN1\Feature\ElementBase;
12
use Sop\ASN1\Type\PrimitiveType;
13
use Sop\ASN1\Type\UniversalClass;
14
15
/**
16
 * Implements *End-of-contents* type.
17
 */
18
class EOC extends Element
19
{
20
    use UniversalClass;
21
    use PrimitiveType;
22
23
    /**
24
     * Constructor.
25
     */
26 32
    public function __construct()
27
    {
28 32
        $this->_typeTag = self::TYPE_EOC;
29 32
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 23
    protected function _encodedContentDER(): string
35
    {
36 23
        return '';
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42 28
    protected static function _decodeFromDER(Identifier $identifier,
43
        string $data, int &$offset): ElementBase
44
    {
45 28
        $idx = $offset;
46 28
        if (!$identifier->isPrimitive()) {
47 1
            throw new DecodeException('EOC value must be primitive.');
48
        }
49
        // EOC type has always zero length
50 27
        Length::expectFromDER($data, $idx, 0);
51 26
        $offset = $idx;
52 26
        return new self();
53
    }
54
}
55