Completed
Push — wip ( 681ec1 )
by z38
02:37
created

ISRReferenceInformation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A asDom() 0 10 1
1
<?php
2
3
namespace Z38\SwissPayment\RemittanceInformation;
4
5
/**
6
 * ISRReferenceInformation
7
 */
8
class ISRReferenceInformation implements RemittanceInformation
9
{
10
    protected $reference;
11
12
    /**
13
     * @param string $reference
14
     */
15 2
    public function __construct($reference)
16
    {
17 2
        $this->reference = $reference;
18 2
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 2
    public function asDom(\DOMDocument $doc)
24
    {
25 2
        $structured = $doc->createElement('Strd');
26 2
        $referenceInformation = $doc->createElement('CdtrRefInf');
27 2
        $reference = $doc->createElement('Ref', $this->reference);
28 2
        $referenceInformation->appendChild($reference);
29 2
        $structured->appendChild($referenceInformation);
30
31 2
        return $structured;
32
    }
33
}
34