Passed
Push — master ( 48ec12...d2181c )
by Esteban De La Fuente
06:08
created

IntegrationComponent   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Test Coverage

Coverage 17.39%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 73
ccs 4
cts 23
cp 0.1739
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getSiiDocumentSenderWorker() 0 3 1
A getSiiDocumentValidatorWorker() 0 3 1
A getSiiDeliveryCheckerWorker() 0 3 1
A getWorkers() 0 9 1
A getSiiLazyWorker() 0 3 1
A getSiiWsdlConsumerWorker() 0 3 1
A getSiiTokenManagerWorker() 0 3 1
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * LibreDTE: Biblioteca PHP (Núcleo).
7
 * Copyright (C) LibreDTE <https://www.libredte.cl>
8
 *
9
 * Este programa es software libre: usted puede redistribuirlo y/o modificarlo
10
 * bajo los términos de la Licencia Pública General Affero de GNU publicada por
11
 * la Fundación para el Software Libre, ya sea la versión 3 de la Licencia, o
12
 * (a su elección) cualquier versión posterior de la misma.
13
 *
14
 * Este programa se distribuye con la esperanza de que sea útil, pero SIN
15
 * GARANTÍA ALGUNA; ni siquiera la garantía implícita MERCANTIL o de APTITUD
16
 * PARA UN PROPÓSITO DETERMINADO. Consulte los detalles de la Licencia Pública
17
 * General Affero de GNU para obtener una información más detallada.
18
 *
19
 * Debería haber recibido una copia de la Licencia Pública General Affero de
20
 * GNU junto a este programa.
21
 *
22
 * En caso contrario, consulte <http://www.gnu.org/licenses/agpl.html>.
23
 */
24
25
namespace libredte\lib\Core\Package\Billing\Component\Integration;
26
27
use Derafu\Lib\Core\Foundation\Abstract\AbstractComponent;
28
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\IntegrationComponentInterface;
29
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiDeliveryCheckerWorkerInterface;
30
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiDocumentSenderWorkerInterface;
31
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiDocumentValidatorWorkerInterface;
32
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiLazyWorkerInterface;
33
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiTokenManagerWorkerInterface;
34
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiWsdlConsumerWorkerInterface;
35
36
/**
37
 * Componente "billing.integration".
38
 */
39
class IntegrationComponent extends AbstractComponent implements IntegrationComponentInterface
40
{
41 1
    public function __construct(
42
        private SiiLazyWorkerInterface $siiLazyWorker,
43
        private SiiWsdlConsumerWorkerInterface $siiWsdlConsumerWorker,
44
        private SiiTokenManagerWorkerInterface $siiTokenManagerWorker,
45
        private SiiDocumentSenderWorkerInterface $siiDocumentSenderWorker,
46
        private SiiDeliveryCheckerWorkerInterface $siiDeliveryCheckerWorker,
47
        private SiiDocumentValidatorWorkerInterface $siiDocumentValidatorWorker
48
    ) {
49 1
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getWorkers(): array
55
    {
56
        return [
57
            'sii_lazy' => $this->siiLazyWorker,
58
            'sii_wsdl_consumer' => $this->siiWsdlConsumerWorker,
59
            'sii_token_manager' => $this->siiTokenManagerWorker,
60
            'sii_document_sender' => $this->siiDocumentSenderWorker,
61
            'sii_delivery_checker' => $this->siiDeliveryCheckerWorker,
62
            'sii_document_validator' => $this->siiDocumentValidatorWorker,
63
        ];
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function getSiiLazyWorker(): SiiLazyWorkerInterface
70
    {
71
        return $this->siiLazyWorker;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getSiiWsdlConsumerWorker(): SiiWsdlConsumerWorkerInterface
78
    {
79
        return $this->siiWsdlConsumerWorker;
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85 1
    public function getSiiTokenManagerWorker(): SiiTokenManagerWorkerInterface
86
    {
87 1
        return $this->siiTokenManagerWorker;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function getSiiDocumentSenderWorker(): SiiDocumentSenderWorkerInterface
94
    {
95
        return $this->siiDocumentSenderWorker;
96
    }
97
98
    /**
99
     * {@inheritdoc}
100
     */
101
    public function getSiiDeliveryCheckerWorker(): SiiDeliveryCheckerWorkerInterface
102
    {
103
        return $this->siiDeliveryCheckerWorker;
104
    }
105
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function getSiiDocumentValidatorWorker(): SiiDocumentValidatorWorkerInterface
110
    {
111
        return $this->siiDocumentValidatorWorker;
112
    }
113
}
114