Completed
Pull Request — master (#4)
by Andrey
16:33 queued 06:52
created

QuoteToAmazonpayConverter::convert()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SprykerEco\Zed\Amazonpay\Business\Payment;
4
5
use Generated\Shared\Transfer\AmazonpayCallTransfer;
6
use Generated\Shared\Transfer\QuoteTransfer;
7
8 View Code Duplication
class QuoteToAmazonpayConverter
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
11
    /**
12
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
13
     *
14
     * @return \Generated\Shared\Transfer\AmazonpayCallTransfer
15
     */
16
    public function convert(QuoteTransfer $quoteTransfer)
17
    {
18
        $amazonpayCallTransfer = new AmazonpayCallTransfer();
19
        $amazonpayCallTransfer->setAmazonpayPayment($quoteTransfer->getAmazonpayPayment())
20
            ->setRequestedAmount($quoteTransfer->getTotals()->getGrandTotal());
21
22
        return $amazonpayCallTransfer;
23
    }
24
25
}
26