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::_encodedContentDER()   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\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