V02::getDecoder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Genkgo\Camt\Camt053\MessageFormat;
6
7
use Genkgo\Camt\Camt053;
8
use Genkgo\Camt\Decoder;
9
use Genkgo\Camt\DecoderInterface;
10
use Genkgo\Camt\MessageFormatInterface;
11
12
final class V02 implements MessageFormatInterface
13
{
14 3
    public function getXmlNs(): string
15
    {
16 3
        return 'urn:iso:std:iso:20022:tech:xsd:camt.053.001.02';
17
    }
18
19 10
    public function getMsgId(): string
20
    {
21 10
        return 'camt.053.001.02';
22
    }
23
24
    public function getName(): string
25
    {
26
        return 'BankToCustomerStatementV02';
27
    }
28
29 10
    public function getDecoder(): DecoderInterface
30
    {
31 10
        $entryTransactionDetailDecoder = new Camt053\Decoder\EntryTransactionDetail(new Decoder\Date());
32 10
        $entryDecoder = new Decoder\Entry($entryTransactionDetailDecoder);
33 10
        $recordDecoder = new Decoder\Record($entryDecoder, new Decoder\Date());
34 10
        $messageDecoder = new Camt053\Decoder\Message($recordDecoder, new Decoder\Date());
35
36 10
        return new Decoder($messageDecoder, sprintf('/assets/%s.xsd', $this->getMsgId()));
37
    }
38
}
39