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.
Test Failed
Push — master ( 405cf3...79c9ba )
by Joni
04:48
created

ExtensionRequestValue::toASN1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\CertificationRequest\Attribute;
6
7
use Sop\ASN1\Element;
8
use Sop\ASN1\Type\UnspecifiedType;
9
use Sop\X501\ASN1\AttributeValue\AttributeValue;
10
use Sop\X501\MatchingRule\BinaryMatch;
11
use Sop\X501\MatchingRule\MatchingRule;
12
use Sop\X509\Certificate\Extensions;
13
14
/**
15
 * Implements value for 'Extension request' attribute.
16
 *
17
 * @see https://tools.ietf.org/html/rfc2985#page-17
18
 */
19
class ExtensionRequestValue extends AttributeValue
20
{
21
    const OID = '1.2.840.113549.1.9.14';
22
23
    /**
24
     * Extensions.
25
     *
26
     * @var Extensions
27
     */
28
    protected $_extensions;
29
30
    /**
31
     * Constructor.
32
     *
33
     * @param Extensions $extensions
34 11
     */
35
    public function __construct(Extensions $extensions)
36 11
    {
37 11
        $this->_extensions = $extensions;
38 11
        $this->_oid = self::OID;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     *
44
     * @return self
45
     */
46 6
    public static function fromASN1(UnspecifiedType $el): AttributeValue
47
    {
48 6
        return new self(Extensions::fromASN1($el->asSequence()));
49
    }
50
51
    /**
52
     * Get requested extensions.
53
     *
54
     * @return Extensions
55
     */
56 4
    public function extensions(): Extensions
57
    {
58 4
        return $this->_extensions;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function toASN1(): Element
65
    {
66 10
        return $this->_extensions->toASN1();
67
    }
68 10
69
    /**
70
     * {@inheritdoc}
71
     */
72
    public function stringValue(): string
73
    {
74
        return '#' . bin2hex($this->toASN1()->toDER());
75
    }
76 3
77
    /**
78 3
     * {@inheritdoc}
79
     */
80
    public function equalityMatchingRule(): MatchingRule
81
    {
82
        return new BinaryMatch();
83
    }
84
85
    /**
86 1
     * {@inheritdoc}
87
     */
88 1
    public function rfc2253String(): string
89
    {
90
        return $this->stringValue();
91
    }
92
93
    /**
94
     * {@inheritdoc}
95
     */
96 1
    protected function _transcodedString(): string
97
    {
98 1
        return $this->stringValue();
99
    }
100
}
101