Test Failed
Push — master ( 4516e7...6ee9d0 )
by Esteban De La Fuente
04:23
created

PrimePackage::getTemplateComponent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Derafu: Biblioteca PHP (Núcleo).
7
 * Copyright (C) Derafu <https://www.derafu.org>
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 GNU
20
 * junto a este programa.
21
 *
22
 * En caso contrario, consulte <http://www.gnu.org/licenses/agpl.html>.
23
 */
24
25
namespace Derafu\Lib\Core\Package\Prime;
26
27
use Derafu\Lib\Core\Foundation\Abstract\AbstractPackage;
28
use Derafu\Lib\Core\Package\Prime\Component\Certificate\Contract\CertificateComponentInterface;
29
use Derafu\Lib\Core\Package\Prime\Component\Entity\Contract\EntityComponentInterface;
30
use Derafu\Lib\Core\Package\Prime\Component\Log\Contract\LogComponentInterface;
31
use Derafu\Lib\Core\Package\Prime\Component\Signature\Contract\SignatureComponentInterface;
32
use Derafu\Lib\Core\Package\Prime\Component\Template\Contract\TemplateComponentInterface;
33
use Derafu\Lib\Core\Package\Prime\Component\Xml\Contract\XmlComponentInterface;
34
use Derafu\Lib\Core\Package\Prime\Contract\PrimePackageInterface;
35
36
/**
37
 * Clase del paquete Prime.
38
 */
39
class PrimePackage extends AbstractPackage implements PrimePackageInterface
40
{
41
    /**
42
     * Constructor del paquete.
43
     *
44
     * @param CertificateComponentInterface $certificate
45
     * @param LogComponentInterface $log
46
     * @param SignatureComponentInterface $signature
47
     * @param XmlComponentInterface $xml
48
     */
49
    public function __construct(
50
        private CertificateComponentInterface $certificate,
51
        private EntityComponentInterface $entity,
52
        private LogComponentInterface $log,
53
        private SignatureComponentInterface $signature,
54
        private TemplateComponentInterface $template,
55
        private XmlComponentInterface $xml,
56
    ) {
57
    }
58
59
    /**
60
     * {@inheritDoc}
61
     */
62
    public function getComponents(): array
63
    {
64
        return [
65
            'certificate' => $this->certificate,
66
            'entity' => $this->entity,
67
            'log' => $this->log,
68
            'signature' => $this->signature,
69
            'template' => $this->template,
70
            'xml' => $this->xml,
71
        ];
72
    }
73
74
    /**
75
     * {@inheritDoc}
76
     */
77
    public function getCertificateComponent(): CertificateComponentInterface
78
    {
79
        return $this->certificate;
80
    }
81
82
    /**
83
     * {@inheritDoc}
84
     */
85
    public function getEntityComponent(): EntityComponentInterface
86
    {
87
        return $this->entity;
88
    }
89
90
    /**
91
     * {@inheritDoc}
92
     */
93
    public function getLogComponent(): LogComponentInterface
94
    {
95
        $config = $this->getComponentConfiguration('log');
96
97
        return $this->log->setConfiguration($config);
98
    }
99
100
    /**
101
     * {@inheritDoc}
102
     */
103
    public function getSignatureComponent(): SignatureComponentInterface
104
    {
105
        return $this->signature;
106
    }
107
108
    /**
109
     * {@inheritDoc}
110
     */
111
    public function getTemplateComponent(): TemplateComponentInterface
112
    {
113
        return $this->template;
114
    }
115
116
    /**
117
     * {@inheritDoc}
118
     */
119
    public function getXmlComponent(): XmlComponentInterface
120
    {
121
        return $this->xml;
122
    }
123
}
124