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.

RelativeOID   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 33
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A _encodedContentDER() 0 3 1
A _decodeFromDER() 0 8 1
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\Feature\ElementBase;
10
11
/**
12
 * Implements *RELATIVE-OID* type.
13
 */
14
class RelativeOID extends ObjectIdentifier
15
{
16
    /**
17
     * Constructor.
18
     *
19
     * @param string $oid OID in dotted format
20
     */
21 5
    public function __construct(string $oid)
22
    {
23 5
        $this->_oid = $oid;
24 5
        $this->_subids = self::_explodeDottedOID($oid);
25 5
        $this->_typeTag = self::TYPE_RELATIVE_OID;
26 5
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 3
    protected function _encodedContentDER(): string
32
    {
33 3
        return self::_encodeSubIDs(...$this->_subids);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39 2
    protected static function _decodeFromDER(Identifier $identifier,
40
        string $data, int &$offset): ElementBase
41
    {
42 2
        $idx = $offset;
43 2
        $len = Length::expectFromDER($data, $idx)->intLength();
44 2
        $subids = self::_decodeSubIDs(substr($data, $idx, $len));
45 2
        $offset = $idx + $len;
46 2
        return new self(self::_implodeSubIDs(...$subids));
47
    }
48
}
49