|
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
|
|
|
|