Completed
Push — feature/ECO-1185-eco-ci ( 4da4ac...5d4add )
by Andrey
13:41 queued 10:25
created

createGuestCustomerDataQuoteUpdater()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
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 SprykerEco\Zed\AmazonPay\Business\Api\Adapter\AdapterFactoryInterface;
11
use SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToShipmentInterface;
12
13
class QuoteUpdateFactory implements QuoteUpdateFactoryInterface
14
{
15
    /**
16
     * @var \SprykerEco\Zed\AmazonPay\Business\Api\Adapter\AdapterFactoryInterface
17
     */
18
    protected $adapterFactory;
19
20
    /**
21
     * @var \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToShipmentInterface
22
     */
23
    protected $shipmentFacade;
24
25
    /**
26
     * @param \SprykerEco\Zed\AmazonPay\Business\Api\Adapter\AdapterFactoryInterface $adapterFactory
27
     * @param \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToShipmentInterface $shipmentFacade
28
     */
29
    public function __construct(
30
        AdapterFactoryInterface $adapterFactory,
31
        AmazonPayToShipmentInterface $shipmentFacade
32
    ) {
33
        $this->adapterFactory = $adapterFactory;
34
        $this->shipmentFacade = $shipmentFacade;
35
    }
36
37
    /**
38
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
39
     */
40
    public function createShippingAddressQuoteDataUpdater()
41
    {
42
        return new ShippingAddressDataQuoteUpdater(
43
            $this->adapterFactory->createSetOrderReferenceDetailsAmazonpayAdapter()
44
        );
45
    }
46
47
    /**
48
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
49
     */
50
    public function createQuoteUpdaterCollection()
51
    {
52
        return new QuoteUpdaterCollection(
53
            [
54
                $this->createAmazonpayDataQuoteInitializer(),
55
                $this->createGuestCustomerDataQuoteUpdater(),
56
                $this->createShipmentDataQuoteInitializer(),
57
                $this->createPaymentDataQuoteUpdater(),
58
            ]
59
        );
60
    }
61
62
    /**
63
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
64
     */
65
    public function createAmazonpayDataQuoteInitializer()
66
    {
67
        return new AmazonpayDataQuoteInitializer();
68
    }
69
70
    /**
71
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
72
     */
73
    public function createShipmentDataQuoteInitializer()
74
    {
75
        return new ShipmentDataQuoteInitializer();
76
    }
77
78
    /**
79
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
80
     */
81
    public function createShipmentDataQuoteUpdater()
82
    {
83
        return new ShipmentDataQuoteUpdater(
84
            $this->shipmentFacade
85
        );
86
    }
87
88
    /**
89
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
90
     */
91
    protected function createGuestCustomerDataQuoteUpdater()
92
    {
93
        return new GuestCustomerDataQuoteUpdater(
94
            $this->adapterFactory->createObtainProfileInformationAdapter()
95
        );
96
    }
97
98
    /**
99
     * @return \SprykerEco\Zed\AmazonPay\Business\Quote\QuoteUpdaterInterface
100
     */
101
    protected function createPaymentDataQuoteUpdater()
102
    {
103
        return new PaymentDataQuoteUpdater();
104
    }
105
}
106