Issues (24)

src/Decoder/Entry.php (11 issues)

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
It seems like $xmlDetail can also be of type null; however, parameter $xmlDetail of Genkgo\Camt\Decoder\Entr...nDetail::addReference() 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 ignore-type  annotation

27
                $this->entryTransactionDetailDecoder->addReference($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

28
                $this->entryTransactionDetailDecoder->addRelatedParties($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

29
                $this->entryTransactionDetailDecoder->addRelatedAgents($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

30
                $this->entryTransactionDetailDecoder->addRemittanceInformation($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

31
                $this->entryTransactionDetailDecoder->addRelatedDates($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

32
                $this->entryTransactionDetailDecoder->addReturnInformation($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

33
                $this->entryTransactionDetailDecoder->addAdditionalTransactionInformation($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

34
                $this->entryTransactionDetailDecoder->addBankTransactionCode($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

35
                $this->entryTransactionDetailDecoder->addCharges($detail, /** @scrutinizer ignore-type */ $xmlDetail);
Loading history...
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 ignore-type  annotation

36
                $this->entryTransactionDetailDecoder->addAmountDetails($detail, /** @scrutinizer ignore-type */ $xmlDetail, $xmlEntry->CdtDbtInd);
Loading history...
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 ignore-type  annotation

37
                $this->entryTransactionDetailDecoder->addAmount($detail, /** @scrutinizer ignore-type */ $xmlDetail, $xmlEntry->CdtDbtInd);
Loading history...
38 23
39 23
                $entry->addTransactionDetail($detail);
40
            }
41 23
        }
42
    }
43
}
44