Passed
Pull Request — dev (#9)
by Andrey
08:48 queued 04:25
created

TransactionCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A __construct() 0 7 1
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\AmazonPay\Business\Payment\Handler\Transaction;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
1 ignored issue
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...
11
use SprykerEco\Zed\AmazonPay\Business\Converter\AmazonPayConverterInterface;
12
13
class TransactionCollection extends AbstractTransactionCollection implements TransactionCollectionInterface
14
{
15
    /**
16
     * @var \SprykerEco\Zed\AmazonPay\Business\Converter\AmazonPayConverterInterface
17
     */
18
    protected $converter;
19
20
    /**
21
     * @param \SprykerEco\Zed\AmazonPay\Business\Payment\Handler\Transaction\AmazonpayTransactionInterface[] $transactionHandlers
22
     * @param \SprykerEco\Zed\AmazonPay\Business\Converter\AmazonPayConverterInterface $converter
23
     */
24
    public function __construct(
25
        array $transactionHandlers,
26
        AmazonPayConverterInterface $converter
27
    ) {
28
        parent::__construct($transactionHandlers);
29
30
        $this->converter = $converter;
31
    }
32
33
    /**
34
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
35
     *
36
     * @return \Generated\Shared\Transfer\QuoteTransfer
37
     */
38
    public function execute(QuoteTransfer $quoteTransfer)
39
    {
40
        $amazonpayCallTransfer = $this->converter->mapToAmazonpayCallTransfer($quoteTransfer);
41
        $amazonpayCallTransfer = $this->executeHandlers($amazonpayCallTransfer);
42
        $quoteTransfer->fromArray($amazonpayCallTransfer->modifiedToArray(), true);
43
44
        return $quoteTransfer;
45
    }
46
}
47