PaymentInitHeadMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 45
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A map() 0 10 1
A __construct() 0 8 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\Ratepay\Business\Api\Mapper;
9
10
use Generated\Shared\Transfer\RatepayPaymentInitTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...epayPaymentInitTransfer 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\RatepayRequestHeadTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...epayRequestHeadTransfer 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 Generated\Shared\Transfer\RatepayRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RatepayRequestTransfer 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...
13
use SprykerEco\Zed\Ratepay\RatepayConfig;
14
15
class PaymentInitHeadMapper extends BaseMapper
16
{
17
    /**
18
     * @var \Generated\Shared\Transfer\RatepayPaymentInitTransfer
19
     */
20
    protected $ratepayPaymentInitTransfer;
21
22
    /**
23
     * @var \SprykerEco\Zed\Ratepay\RatepayConfig
24
     */
25
    protected $config;
26
27
    /**
28
     * @var \Generated\Shared\Transfer\RatepayRequestTransfer
29
     */
30
    protected $requestTransfer;
31
32
    /**
33
     * @param \Generated\Shared\Transfer\RatepayPaymentInitTransfer $ratepayPaymentInitTransfer
34
     * @param \SprykerEco\Zed\Ratepay\RatepayConfig $config
35
     * @param \Generated\Shared\Transfer\RatepayRequestTransfer $requestTransfer
36
     */
37
    public function __construct(
38
        RatepayPaymentInitTransfer $ratepayPaymentInitTransfer,
39
        RatepayConfig $config,
40
        RatepayRequestTransfer $requestTransfer
41
    ) {
42
        $this->ratepayPaymentInitTransfer = $ratepayPaymentInitTransfer;
43
        $this->config = $config;
44
        $this->requestTransfer = $requestTransfer;
45
    }
46
47
    /**
48
     * @return void
49
     */
50
    public function map()
51
    {
52
        $this->requestTransfer->setHead(new RatepayRequestHeadTransfer())->getHead()
53
            ->setTransactionId($this->ratepayPaymentInitTransfer->getTransactionId())
54
            ->setTransactionShortId($this->ratepayPaymentInitTransfer->getTransactionShortId())
55
            ->setCustomerId($this->ratepayPaymentInitTransfer->getCustomerId())
56
            ->setDeviceFingerprint($this->ratepayPaymentInitTransfer->getDeviceFingerprint())
57
            ->setSystemId($this->config->getSystemId())
58
            ->setProfileId($this->config->getProfileId())
59
            ->setSecurityCode($this->config->getSecurityCode());
60
    }
61
}
62