HNVSD::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Fhp\Segment;
4
5
use Fhp\DataTypes\Bin;
6
7
/**
8
 * Class HNVSD (Verschlüsselte Daten)
9
 * Segment type: Administration
10
 *
11
 * @link: http://www.hbci-zka.de/dokumente/spezifikation_deutsch/fintsv3/FinTS_3.0_Security_Sicherheitsverfahren_HBCI_Rel_20130718_final_version.pdf
12
 * Section: B.5.4
13
 *
14
 * @package Fhp\Segment
15
 */
16
class HNVSD extends AbstractSegment
17
{
18
    const NAME = 'HNVSD';
19
    const VERSION = 1;
20
21
    /**
22
     * HNVSD constructor.
23
     * @param int $segmentNumber
24
     * @param string $encodedData
25
     */
26 4
    public function __construct($segmentNumber, $encodedData)
27
    {
28 4
        parent::__construct(
29 4
            static::NAME,
30 4
            $segmentNumber,
31 4
            static::VERSION,
32 4
            array(new Bin($encodedData))
33 4
        );
34 4
    }
35
36
    /**
37
     * @return Bin
38
     */
39 4
    public function getEncodedData()
40
    {
41 4
        $des = $this->getDataElements();
42
43 4
        return $des[0];
44
    }
45
46
    /**
47
     * @param string $data
48
     */
49 4
    public function setEncodedData($data)
50
    {
51 4
        $this->setDataElements(array(new Bin($data)));
52 4
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getName()
58
    {
59
        return static::NAME;
60
    }
61
}
62