TypedAttribute   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 27
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A oid() 0 3 1
A type() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\X501\ASN1\Feature;
6
7
use Sop\X501\ASN1\AttributeType;
8
9
/**
10
 * Trait for attributes having a type.
11
 */
12
trait TypedAttribute
13
{
14
    /**
15
     * Attribute type.
16
     *
17
     * @var AttributeType
18
     */
19
    protected $_type;
20
21
    /**
22
     * Get attribute type.
23
     *
24
     * @return AttributeType
25
     */
26 1
    public function type(): AttributeType
27
    {
28 1
        return $this->_type;
29
    }
30
31
    /**
32
     * Get OID of the attribute.
33
     *
34
     * @return string
35
     */
36 39
    public function oid(): string
37
    {
38 39
        return $this->_type->oid();
39
    }
40
}
41