InitDirectDebitConverter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createResponseTransfer() 0 16 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Computop\Converter;
9
10
use Generated\Shared\Transfer\ComputopApiResponseHeaderTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...iResponseHeaderTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\ComputopDirectDebitInitResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...bitInitResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use SprykerEco\Shared\Computop\Config\ComputopApiConfig;
13
14
class InitDirectDebitConverter extends AbstractInitConverter
15
{
16
    /**
17
     * @param array $decryptedArray
18
     * @param \Generated\Shared\Transfer\ComputopApiResponseHeaderTransfer $header
19
     *
20
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
21
     */
22
    protected function createResponseTransfer(array $decryptedArray, ComputopApiResponseHeaderTransfer $header)
23
    {
24
        $responseTransfer = new ComputopDirectDebitInitResponseTransfer();
25
        $responseTransfer->fromArray($decryptedArray, true);
26
        $responseTransfer->setHeader($header);
27
        //optional fields
28
        $responseTransfer->setBankAccountIban($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::BANK_ACCOUNT_IBAN));
29
        $responseTransfer->setBankAccountBic($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::BANK_ACCOUNT_BIC));
30
        $responseTransfer->setAccountOwner($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::ACCOUNT_OWNER));
31
        $responseTransfer->setAccountBank($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::ACCOUNT_BANK));
32
        $responseTransfer->setMandateId($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::MANDATE_ID));
33
        $responseTransfer->setDateOfSignature($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::DATE_OF_SIGNATURE_ID));
34
        $responseTransfer->setBankAccountPban($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::BANK_ACCOUNT_PBAN));
35
        $responseTransfer->setMdtSeqType($this->computopApiService->getResponseValue($decryptedArray, ComputopApiConfig::MDT_SEQ_TYPE));
36
37
        return $responseTransfer;
38
    }
39
}
40