Factory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 40
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setClient() 0 4 1
A getNamespace() 0 4 1
A getSchema() 0 27 1
1
<?php
2
3
/*
4
 * This file is part of gpupo/netshoes-sdk
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the information of copyright and license you should read the file
7
 * LICENSE which is distributed with this source code.
8
 * Para a informação dos direitos autorais e de licença você deve ler o arquivo
9
 * LICENSE que é distribuído com este código-fonte.
10
 * Para obtener la información de los derechos de autor y la licencia debe leer
11
 * el archivo LICENSE que se distribuye con el código fuente.
12
 * For more information, see <https://www.gpupo.com/>.
13
 */
14
15
namespace Gpupo\NetshoesSdk;
16
17
use Gpupo\CommonSdk\FactoryAbstract;
18
use Gpupo\NetshoesSdk\Client\Client;
19
20
/**
21
 * Construtor principal, extendido pelo Factory de MarkethubBundle.
22
 */
23
class Factory extends FactoryAbstract
24
{
25 1
    public function setClient(array $clientOptions = [])
26
    {
27 1
        $this->client = new Client($clientOptions, $this->logger);
28 1
    }
29
30 15
    public function getNamespace()
31
    {
32 15
        return  '\\'.__NAMESPACE__.'\Entity\\';
33
    }
34
35 15
    protected function getSchema($namespace = null)
36
    {
37
        return [
38
            'product' => [
39 15
                'class'   => $namespace.'Product\Product',
40 15
                'manager' => $namespace.'Product\Manager',
41
            ],
42
            'sku' => [
43 15
                'class'   => $namespace.'Product\Sku\Item',
44 15
                'manager' => $namespace.'Product\Sku\Manager',
45
            ],
46
            'order' => [
47 15
                'class'   => $namespace.'Order\Order',
48 15
                'manager' => $namespace.'Order\Manager',
49
            ],
50
            'invoice' => [
51 15
                'class' => $namespace.'Order\Shippings\Invoice',
52
            ],
53
            'transport' => [
54 15
                'class' => $namespace.'Order\Shippings\Transport',
55
            ],
56
            'templates' => [
57 15
                'class'   => $namespace.'Templates\Templates',
58 15
                'manager' => $namespace.'Templates\Manager',
59
            ],
60
        ];
61
    }
62
}
63