ShipmentDataQuoteInitializer::update()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
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\Quote;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
11
use Generated\Shared\Transfer\ShipmentTransfer;
12
13
class ShipmentDataQuoteInitializer implements QuoteUpdaterInterface
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\QuoteTransfer
19
     */
20
    public function update(QuoteTransfer $quoteTransfer)
21
    {
22
        if (!$quoteTransfer->getShipment()) {
23
            $shipmentTransfer = new ShipmentTransfer();
24
            $quoteTransfer->setShipment($shipmentTransfer);
25
        }
26
27
        return $quoteTransfer;
28
    }
29
}
30