1 | <?php |
||||
2 | |||||
3 | declare(strict_types=1); |
||||
4 | |||||
5 | namespace Genkgo\Camt\Decoder; |
||||
6 | |||||
7 | use Genkgo\Camt\DTO; |
||||
8 | use SimpleXMLElement; |
||||
9 | |||||
10 | class Entry |
||||
11 | { |
||||
12 | private EntryTransactionDetail $entryTransactionDetailDecoder; |
||||
13 | |||||
14 | public function __construct(EntryTransactionDetail $entryTransactionDetailDecoder) |
||||
15 | { |
||||
16 | $this->entryTransactionDetailDecoder = $entryTransactionDetailDecoder; |
||||
17 | 29 | } |
|||
18 | |||||
19 | 29 | public function addTransactionDetails(DTO\Entry $entry, SimpleXMLElement $xmlEntry): void |
|||
20 | 29 | { |
|||
21 | $xmlDetails = $xmlEntry->NtryDtls->TxDtls; |
||||
22 | 24 | ||||
23 | if ($xmlDetails !== null) { |
||||
24 | 24 | foreach ($xmlDetails as $xmlDetail) { |
|||
25 | $detail = new DTO\EntryTransactionDetail(); |
||||
26 | 24 | $this->entryTransactionDetailDecoder->addCreditDebitIdentifier($detail, $xmlEntry->CdtDbtInd); |
|||
27 | 23 | $this->entryTransactionDetailDecoder->addReference($detail, $xmlDetail); |
|||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
28 | 23 | $this->entryTransactionDetailDecoder->addRelatedParties($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...il::addRelatedParties() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
29 | 23 | $this->entryTransactionDetailDecoder->addRelatedAgents($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...ail::addRelatedAgents() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
30 | 23 | $this->entryTransactionDetailDecoder->addRemittanceInformation($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...RemittanceInformation() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
31 | 23 | $this->entryTransactionDetailDecoder->addRelatedDates($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...tail::addRelatedDates() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
32 | 23 | $this->entryTransactionDetailDecoder->addReturnInformation($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...:addReturnInformation() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
33 | 23 | $this->entryTransactionDetailDecoder->addAdditionalTransactionInformation($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...ransactionInformation() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
34 | 23 | $this->entryTransactionDetailDecoder->addBankTransactionCode($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...ddBankTransactionCode() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
35 | 23 | $this->entryTransactionDetailDecoder->addCharges($detail, $xmlDetail); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...ionDetail::addCharges() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
36 | 23 | $this->entryTransactionDetailDecoder->addAmountDetails($detail, $xmlDetail, $xmlEntry->CdtDbtInd); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...ail::addAmountDetails() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
37 | 23 | $this->entryTransactionDetailDecoder->addAmount($detail, $xmlDetail, $xmlEntry->CdtDbtInd); |
|||
0 ignored issues
–
show
It seems like
$xmlDetail can also be of type null ; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...tionDetail::addAmount() does only seem to accept SimpleXMLElement , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
38 | 23 | ||||
39 | 23 | $entry->addTransactionDetail($detail); |
|||
40 | } |
||||
41 | 23 | } |
|||
42 | } |
||||
43 | } |
||||
44 |