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 indefinite (96169e)
by Joni
03:55
created

EOC   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

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

3 Methods

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