DebitResponseMapper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 12
c 1
b 1
f 0
dl 0
loc 27
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDebitResponseTransfer() 0 20 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\Zed\Payone\Business\Api\Response\Mapper;
9
10
use Generated\Shared\Transfer\BaseResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\BaseResponseTransfer 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\DebitResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\DebitResponseTransfer 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\Zed\Payone\Business\Api\Response\Container\DebitResponseContainer;
13
14
class DebitResponseMapper implements DebitResponseMapperInterface
15
{
16
    /**
17
     * @param \SprykerEco\Zed\Payone\Business\Api\Response\Container\DebitResponseContainer $responseContainer
18
     *
19
     * @return \Generated\Shared\Transfer\DebitResponseTransfer
20
     */
21
    public function getDebitResponseTransfer(DebitResponseContainer $responseContainer): DebitResponseTransfer
22
    {
23
        $result = new DebitResponseTransfer();
24
        $baseResponse = new BaseResponseTransfer();
25
26
        // Fill base response transfer
27
        $baseResponse->setErrorCode($responseContainer->getErrorcode());
28
        $baseResponse->setErrorMessage($responseContainer->getErrormessage());
29
        $baseResponse->setCustomerMessage($responseContainer->getCustomermessage());
30
        $baseResponse->setStatus($responseContainer->getStatus());
31
        $baseResponse->setRawResponse($responseContainer->getRawResponse());
32
33
        // Set plain attributes
34
        $result->setTxid($responseContainer->getTxid());
35
        $result->setSettleAccount($responseContainer->getSettleaccount());
36
37
        // Set aggregated transfers
38
        $result->setBaseResponse($baseResponse);
39
40
        return $result;
41
    }
42
}
43