Passed
Push — master ( e7acbe...c65cd9 )
by Esteban De La Fuente
19:00
created

BillingPackage::getIdentifierComponent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
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;
26
27
use Derafu\Lib\Core\Foundation\Abstract\AbstractPackage;
28
use libredte\lib\Core\Package\Billing\Component\Book\Contract\BookComponentInterface;
29
use libredte\lib\Core\Package\Billing\Component\Document\Contract\DocumentComponentInterface;
30
use libredte\lib\Core\Package\Billing\Component\Exchange\Contract\ExchangeComponentInterface;
31
use libredte\lib\Core\Package\Billing\Component\Identifier\Contract\IdentifierComponentInterface;
32
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\IntegrationComponentInterface;
33
use libredte\lib\Core\Package\Billing\Component\OwnershipTransfer\Contract\OwnershipTransferComponentInterface;
34
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\TradingPartiesComponentInterface;
35
use libredte\lib\Core\Package\Billing\Contract\BillingPackageInterface;
36
37
/**
38
 * Paquete de facturación: "billing".
39
 */
40
class BillingPackage extends AbstractPackage implements BillingPackageInterface
41
{
42 126
    public function __construct(
43
        private BookComponentInterface $bookComponent,
44
        private DocumentComponentInterface $documentComponent,
45
        private ExchangeComponentInterface $exchangeComponent,
46
        private IdentifierComponentInterface $identifierComponent,
47
        private IntegrationComponentInterface $integrationComponent,
48
        private OwnershipTransferComponentInterface $ownershipTransferComponent,
49
        private TradingPartiesComponentInterface $tradingPartiesComponent
50
    ) {
51 126
    }
52
53
    /**
54
     * {@inheritDoc}
55
     */
56
    public function getComponents(): array
57
    {
58
        return [
59
            'book' => $this->bookComponent,
60
            'document' => $this->documentComponent,
61
            'exchange' => $this->exchangeComponent,
62
            'identifier' => $this->identifierComponent,
63
            'integration' => $this->integrationComponent,
64
            'ownership_transfer' => $this->ownershipTransferComponent,
65
            'trading_parties' => $this->tradingPartiesComponent,
66
        ];
67
    }
68
69
    /**
70
     * {@inheritDoc}
71
     */
72
    public function getBookComponent(): BookComponentInterface
73
    {
74
        return $this->bookComponent;
75
    }
76
77
    /**
78
     * {@inheritDoc}
79
     */
80 120
    public function getDocumentComponent(): DocumentComponentInterface
81
    {
82 120
        return $this->documentComponent;
83
    }
84
85
    /**
86
     * {@inheritDoc}
87
     */
88
    public function getExchangeComponent(): ExchangeComponentInterface
89
    {
90
        return $this->exchangeComponent;
91
    }
92
93
    /**
94
     * {@inheritDoc}
95
     */
96 106
    public function getIdentifierComponent(): IdentifierComponentInterface
97
    {
98 106
        return $this->identifierComponent;
99
    }
100
101
    /**
102
     * {@inheritDoc}
103
     */
104 1
    public function getIntegrationComponent(): IntegrationComponentInterface
105
    {
106 1
        return $this->integrationComponent;
107
    }
108
109
    /**
110
     * {@inheritDoc}
111
     */
112
    public function getOwnershipTransferComponent(): OwnershipTransferComponentInterface
113
    {
114
        return $this->ownershipTransferComponent;
115
    }
116
117
    /**
118
     * {@inheritDoc}
119
     */
120
    public function getTradingPartiesComponent(): TradingPartiesComponentInterface
121
    {
122
        return $this->tradingPartiesComponent;
123
    }
124
}
125