PunchoutCatalogsBusinessFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createPunchoutCatalogsWriter() 0 6 1
A createPunchoutCatalogsReader() 0 5 1
A getVaultFacade() 0 3 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\PunchoutCatalogs\Business;
9
10
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory;
11
use SprykerEco\Zed\PunchoutCatalogs\Business\Reader\PunchoutCatalogsReader;
12
use SprykerEco\Zed\PunchoutCatalogs\Business\Reader\PunchoutCatalogsReaderInterface;
13
use SprykerEco\Zed\PunchoutCatalogs\Business\Writer\PunchoutCatalogsWriter;
14
use SprykerEco\Zed\PunchoutCatalogs\Business\Writer\PunchoutCatalogsWriterInterface;
15
use SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToVaultFacadeInterface;
16
use SprykerEco\Zed\PunchoutCatalogs\PunchoutCatalogsDependencyProvider;
17
18
/**
19
 * @method \SprykerEco\Zed\PunchoutCatalogs\Persistence\PunchoutCatalogsRepositoryInterface getRepository()
20
 * @method \SprykerEco\Zed\PunchoutCatalogs\Persistence\PunchoutCatalogsEntityManagerInterface getEntityManager()()
21
 * @method \SprykerEco\Zed\PunchoutCatalogs\PunchoutCatalogsConfig getConfig()
22
 */
23
class PunchoutCatalogsBusinessFactory extends AbstractBusinessFactory
24
{
25
    /**
26
     * @return \SprykerEco\Zed\PunchoutCatalogs\Business\Reader\PunchoutCatalogsReaderInterface
27
     */
28
    public function createPunchoutCatalogsReader(): PunchoutCatalogsReaderInterface
29
    {
30
        return new PunchoutCatalogsReader(
31
            $this->getRepository(),
32
            $this->getVaultFacade()
33
        );
34
    }
35
36
    /**
37
     * @return \SprykerEco\Zed\PunchoutCatalogs\Business\Writer\PunchoutCatalogsWriterInterface
38
     */
39
    public function createPunchoutCatalogsWriter(): PunchoutCatalogsWriterInterface
40
    {
41
        return new PunchoutCatalogsWriter(
42
            $this->getEntityManager(),
43
            $this->getVaultFacade(),
44
            $this->getRepository()
45
        );
46
    }
47
48
    /**
49
     * @return \SprykerEco\Zed\PunchoutCatalogs\Dependency\Facade\PunchoutCatalogsToVaultFacadeInterface
50
     */
51
    public function getVaultFacade(): PunchoutCatalogsToVaultFacadeInterface
52
    {
53
        return $this->getProvidedDependency(PunchoutCatalogsDependencyProvider::FACADE_VAULT);
54
    }
55
}
56