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 php72 (a7f01e)
by Joni
04:53
created

InhibitAnyPolicyExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X509\Certificate\Extension;
6
7
use Sop\ASN1\Element;
8
use Sop\ASN1\Type\Primitive\Integer;
9
use Sop\ASN1\Type\UnspecifiedType;
10
11
/**
12
 * Implements 'Inhibit anyPolicy' extension.
13
 *
14
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.14
15
 */
16
class InhibitAnyPolicyExtension extends Extension
17
{
18
    /**
19
     * @var int
20
     */
21
    protected $_skipCerts;
22
23
    /**
24
     * Constructor.
25
     *
26
     * @param bool $critical
27
     * @param int  $skip_certs
28
     */
29 10
    public function __construct(bool $critical, int $skip_certs)
30
    {
31 10
        parent::__construct(self::OID_INHIBIT_ANY_POLICY, $critical);
32 10
        $this->_skipCerts = $skip_certs;
33 10
    }
34
35
    /**
36
     * Get value.
37
     *
38
     * @return int
39
     */
40 4
    public function skipCerts(): int
41
    {
42 4
        return $this->_skipCerts;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 9
    protected static function _fromDER(string $data, bool $critical): Extension
49
    {
50 9
        return new self($critical,
51 9
            UnspecifiedType::fromDER($data)->asInteger()->intNumber());
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57 17
    protected function _valueASN1(): Element
58
    {
59 17
        return new Integer($this->_skipCerts);
60
    }
61
}
62