Retorno   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 103
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 7
Bugs 0 Features 0
Metric Value
wmc 9
c 7
b 0
f 0
lcom 1
cbo 2
dl 0
loc 103
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addLote() 0 5 1
A removeLote() 0 5 1
A getHeader() 0 4 1
A getTrailer() 0 4 1
A setHeader() 0 4 1
A setTrailer() 0 4 1
A getLotes() 0 4 1
A setLotes() 0 5 1
1
<?php
2
3
namespace Umbrella\Ya\RetornoBoleto;
4
5
use Easy\Collections\ArrayList;
6
use Easy\Collections\VectorInterface;
7
use Umbrella\Ya\RetornoBoleto\Cnab\CnabHeaderInterface;
8
use Umbrella\Ya\RetornoBoleto\Cnab\CnabTrailerInterface;
9
10
/**
11
 * Classe que representa um arquivo de retorno genérico.
12
 */
13
class Retorno implements RetornoInterface
14
{
15
    /**
16
     * @var CnabHeaderInterface
17
     */
18
    protected $header;
19
20
    /**
21
     * @var VectorInterface
22
     */
23
    protected $lotes;
24
25
    /**
26
     * @var CnabTrailerInterface
27
     */
28
    protected $trailer;
29
30
    /**
31
     * Inicializa uma instância da classe Retorno.
32
     */
33
    public function __construct()
34
    {
35
        $this->lotes = new ArrayList();
36
    }
37
38
    /**
39
     * Adiciona um lote.
40
     * @param LoteInterface $lote
41
     * @return Retorno
42
     */
43
    public function addLote(LoteInterface $lote)
44
    {
45
        $this->lotes->add($lote);
46
        return $this;
47
    }
48
49
    /**
50
     * Remove um lote.
51
     * @param LoteInterface $lote
52
     * @return Retorno
53
     */
54
    public function removeLote(LoteInterface $lote)
55
    {
56
        $this->lotes->remove($lote);
57
        return $this;
58
    }
59
60
    /**
61
     * Recupera o header do arquivo.
62
     * @return CnabHeaderInterface
63
     */
64
    public function getHeader()
65
    {
66
        return $this->header;
67
    }
68
69
    /**
70
     * Recupera o trailer do arquivo.
71
     * @return CnabTrailerInterface
72
     */
73
    public function getTrailer()
74
    {
75
        return $this->trailer;
76
    }
77
78
    /**
79
     * Define o header do arquivo.
80
     * @param CnabHeaderInterface $header
81
     */
82
    public function setHeader(CnabHeaderInterface $header)
83
    {
84
        $this->header = $header;
85
    }
86
87
    /**
88
     * Define o trailer do arquivo.
89
     * @param CnabTrailerInterface $trailer
90
     */
91
    public function setTrailer(CnabTrailerInterface $trailer)
92
    {
93
        $this->trailer = $trailer;
94
    }
95
96
    /**
97
     * Recupera todos os lotes do arquivo.
98
     * @return VectorInterface
99
     */
100
    public function getLotes()
101
    {
102
        return $this->lotes;
103
    }
104
105
    /**
106
     * Define todos os lotes do arquivo.
107
     * @param VectorInterface $lotes
108
     * @return Retorno
109
     */
110
    public function setLotes(VectorInterface $lotes)
111
    {
112
        $this->lotes = $lotes;
113
        return $this;
114
    }
115
}
116