Passed
Branch master (0b4ab1)
by Esteban De La Fuente
74:02 queued 50:02
created

PrimePackage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Test Coverage

Coverage 64.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 61
ccs 11
cts 17
cp 0.6471
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getComponents() 0 7 1
A getLogComponent() 0 3 1
A getCertificateComponent() 0 3 1
A getSignatureComponent() 0 3 1
A getXmlComponent() 0 3 1
A __construct() 0 6 1
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\Log\Contract\LogComponentInterface;
30
use Derafu\Lib\Core\Package\Prime\Component\Signature\Contract\SignatureComponentInterface;
31
use Derafu\Lib\Core\Package\Prime\Component\Xml\Contract\XmlComponentInterface;
32
use Derafu\Lib\Core\Package\Prime\Contract\PrimePackageInterface;
33
34
/**
35
 * Clase del paquete Prime.
36
 */
37
class PrimePackage extends AbstractPackage implements PrimePackageInterface
38
{
39
    /**
40
     * Constructor del paquete.
41
     *
42
     * @param CertificateComponentInterface $certificate
43
     * @param LogComponentInterface $log
44
     * @param SignatureComponentInterface $signature
45
     * @param XmlComponentInterface $xml
46
     */
47 2
    public function __construct(
48
        private CertificateComponentInterface $certificate,
49
        private LogComponentInterface $log,
50
        private SignatureComponentInterface $signature,
51
        private XmlComponentInterface $xml,
52
    ) {
53 2
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58 1
    public function getComponents(): array
59
    {
60 1
        return [
61 1
            'certificate' => $this->certificate,
62 1
            'log' => $this->log,
63 1
            'signature' => $this->signature,
64 1
            'xml' => $this->xml,
65 1
        ];
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71
    public function getCertificateComponent(): CertificateComponentInterface
72
    {
73
        return $this->certificate;
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     */
79
    public function getLogComponent(): LogComponentInterface
80
    {
81
        return $this->log;
82
    }
83
84
    /**
85
     * {@inheritdoc}
86
     */
87
    public function getSignatureComponent(): SignatureComponentInterface
88
    {
89
        return $this->signature;
90
    }
91
92
    /**
93
     * {@inheritdoc}
94
     */
95 1
    public function getXmlComponent(): XmlComponentInterface
96
    {
97 1
        return $this->xml;
98
    }
99
}
100