TypedAttribute::type()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
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\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