Passed
Push — feature/eco-3656/eco-3658-enab... ( da021b...202423 )
by
unknown
04:29
created

ComputopFactory   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 35
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getZedRequestClient() 0 3 1
A createZedStub() 0 5 1
A getShipmentClient() 0 3 1
A createComputopQuoteDefaultShipmentExpander() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Client\Computop;
9
10
use Spryker\Client\Kernel\AbstractFactory;
11
use Spryker\Client\ZedRequest\ZedRequestClientInterface;
12
use SprykerEco\Client\Computop\Dependency\Client\ComputopToShipmentClientInterface;
13
use SprykerEco\Client\Computop\Zed\ComputopStub;
14
use SprykerEco\Client\Computop\Zed\ComputopStubInterface;
15
16
/**
17
 * @method \SprykerEco\Client\Computop\ComputopConfig getConfig()
18
 */
19
class ComputopFactory extends AbstractFactory
20
{
21
    /**
22
     * @return \SprykerEco\Client\Computop\Zed\ComputopStubInterface
23
     */
24
    public function createZedStub(): ComputopStubInterface
25
    {
26
        return new ComputopStub(
27
            $this->getZedRequestClient(),
28
            $this->getConfig()
29
        );
30
    }
31
32
    /**
33
     * @return \Spryker\Client\ZedRequest\ZedRequestClientInterface
34
     */
35
    public function getZedRequestClient(): ZedRequestClientInterface
36
    {
37
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_ZED_REQUEST);
38
    }
39
40
    /**
41
     * @return \SprykerEco\Client\Computop\Dependency\Client\ComputopToShipmentClientInterface
42
     */
43
    public function getShipmentClient(): ComputopToShipmentClientInterface
44
    {
45
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_SHIPMENT);
46
    }
47
48
    /**
49
     * @return \SprykerEco\Client\Computop\ComputopQuoteDefaultShipmentExpanderInterface
50
     */
51
    public function createComputopQuoteDefaultShipmentExpander(): ComputopQuoteDefaultShipmentExpanderInterface
52
    {
53
        return new ComputopQuoteDefaultShipmentExpander($this->getContainer()->getLocator()->computop()->client());
54
    }
55
}
56