Passed
Push — feature/eco-574/eco-2266-check... ( efd21d )
by Aleksey
08:13
created

QuoteToCallConverter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 12 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\Afterpay\Communication\Converter;
9
10
use Generated\Shared\Transfer\AfterpayCallTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\AfterpayCallTransfer 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\QuoteTransfer;
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...
12
13
class QuoteToCallConverter implements QuoteToCallConverterInterface
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\AfterpayCallTransfer
19
     */
20
    public function convert(QuoteTransfer $quoteTransfer): AfterpayCallTransfer
21
    {
22
        $afterpayCallTransfer = new AfterpayCallTransfer();
23
        $afterpayCallTransfer->setOrderReference($quoteTransfer->getOrderReference());
24
        $afterpayCallTransfer->setEmail($quoteTransfer->getCustomer()->getEmail());
25
        $afterpayCallTransfer->setItems($quoteTransfer->getItems());
26
        $afterpayCallTransfer->setBillingAddress($quoteTransfer->getBillingAddress());
27
        $afterpayCallTransfer->setShippingAddress($quoteTransfer->getShippingAddress());
28
        $afterpayCallTransfer->setTotals($quoteTransfer->getTotals());
29
        $afterpayCallTransfer->setPaymentMethod($quoteTransfer->getPayment()->getPaymentSelection());
30
31
        return $afterpayCallTransfer;
32
    }
33
}
34