SecurityDateTime   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 26
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
namespace Fhp\DataElementGroups;
4
5
use Fhp\Deg;
6
7
/**
8
 * Class SecurityDateTime.
9
 * @package Fhp\DataElementGroups
10
 */
11
class SecurityDateTime extends Deg
12
{
13
    /**
14
     *  Sicherheitszeitstempel (STS)
15
     */
16
    const DATETIME_TYPE_STS = 1;
17
18
    /**
19
     * Certificate Revocation Time (CRT)
20
     */
21
    const DATETIME_TYPE_CRT = 6;
22
23
    /**
24
     * SecurityDateTime constructor.
25
     *
26
     * @param int $type
27
     * @param \DateTime|null $dateTime
28
     */
29 5
    public function __construct($type = self::DATETIME_TYPE_STS, \DateTime $dateTime = null)
30
    {
31 5
        $date = null == $dateTime ? new \DateTime() : $dateTime;
32 5
        $this->addDataElement($type);
33 5
        $this->addDataElement($date->format('Ymd'));
34 5
        $this->addDataElement($date->format('His'));
35 5
    }
36
}
37