Completed
Push — master ( 9db63e...40913a )
by Oleksandr
24s queued 13s
created

PayoneRequestProductDataMapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A mapProductData() 0 7 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\Payment\DataMapper;
9
10
use SprykerEco\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer;
11
12
class PayoneRequestProductDataMapper implements PayoneRequestProductDataMapperInterface
13
{
14
    /**
15
     * @var \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ProductMapperInterface
16
     */
17
    protected $productMapper;
18
19
    /**
20
     * @var \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ShipmentMapperInterface
21
     */
22
    protected $shipmentMapper;
23
24
    /**
25
     * @var \SprykerEco\Zed\Payone\Business\Payment\DataMapper\DiscountMapperInterface
26
     */
27
    protected $discountMapper;
28
29
    /**
30
     * @param \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ProductMapperInterface $productMapper
31
     * @param \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ShipmentMapperInterface $shipmentMapper
32
     * @param \SprykerEco\Zed\Payone\Business\Payment\DataMapper\DiscountMapperInterface $discountMapper
33
     */
34
    public function __construct(
35
        ProductMapperInterface $productMapper,
36
        ShipmentMapperInterface $shipmentMapper,
37
        DiscountMapperInterface $discountMapper
38
    ) {
39
        $this->productMapper = $productMapper;
40
        $this->shipmentMapper = $shipmentMapper;
41
        $this->discountMapper = $discountMapper;
42
    }
43
44
    /**
45
     * @param \Generated\Shared\Transfer\OrderTransfer|\Generated\Shared\Transfer\QuoteTransfer $itemsContainer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer 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...
Bug introduced by
The type Generated\Shared\Transfer\OrderTransfer 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...
46
     * @param \SprykerEco\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer $requestContainer
47
     *
48
     * @return \SprykerEco\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer
49
     */
50
    public function mapProductData($itemsContainer, AbstractRequestContainer $requestContainer): AbstractRequestContainer
51
    {
52
        $this->productMapper->mapProductItems($itemsContainer, $requestContainer);
53
        $this->shipmentMapper->mapShipment($itemsContainer, $requestContainer);
54
        $this->discountMapper->mapDiscounts($itemsContainer, $requestContainer);
55
56
        return $requestContainer;
57
    }
58
}
59