NoRevocationAvailableExtension   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A _fromDER() 0 5 1
A _valueASN1() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace X509\Certificate\Extension;
6
7
use ASN1\Type\Primitive\NullType;
8
9
/**
10
 * Implements 'No Revocation Available' certificate extension.
11
 *
12
 * @link https://tools.ietf.org/html/rfc5755#section-4.3.6
13
 */
14
class NoRevocationAvailableExtension extends Extension
15
{
16
    /**
17
     * Constructor.
18
     *
19
     * @param bool $critical
20
     */
21 4
    public function __construct(bool $critical)
22
    {
23 4
        parent::__construct(self::OID_NO_REV_AVAIL, $critical);
24 4
    }
25
    
26
    /**
27
     *
28
     * {@inheritdoc}
29
     * @return self
30
     */
31 3
    protected static function _fromDER(string $data, bool $critical): self
32
    {
33 3
        NullType::fromDER($data);
34 3
        return new self($critical);
35
    }
36
    
37
    /**
38
     *
39
     * {@inheritdoc}
40
     * @return NullType
41
     */
42 4
    protected function _valueASN1(): NullType
43
    {
44 4
        return new NullType();
45
    }
46
}
47