RelativeName   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A rdn() 0 4 1
A _valueASN1() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace X509\Certificate\Extension\DistributionPoint;
6
7
use ASN1\Type\Constructed\Set;
8
use X501\ASN1\RDN;
9
10
/**
11
 * Implements 'nameRelativeToCRLIssuer' ASN.1 CHOICE type of
12
 * <i>DistributionPointName</i> used by 'CRL Distribution Points'
13
 * certificate extension.
14
 *
15
 * @link https://tools.ietf.org/html/rfc5280#section-4.2.1.13
16
 */
17
class RelativeName extends DistributionPointName
18
{
19
    /**
20
     * Relative distinguished name.
21
     *
22
     * @var RDN $_rdn
23
     */
24
    protected $_rdn;
25
    
26
    /**
27
     * Constructor.
28
     *
29
     * @param RDN $rdn
30
     */
31 12
    public function __construct(RDN $rdn)
32
    {
33 12
        $this->_tag = self::TAG_RDN;
34 12
        $this->_rdn = $rdn;
35 12
    }
36
    
37
    /**
38
     * Get RDN.
39
     *
40
     * @return RDN
41
     */
42 2
    public function rdn(): RDN
43
    {
44 2
        return $this->_rdn;
45
    }
46
    
47
    /**
48
     *
49
     * {@inheritdoc}
50
     * @return Set
51
     */
52 16
    protected function _valueASN1(): Set
53
    {
54 16
        return $this->_rdn->toASN1();
55
    }
56
}
57