Pagamento   A
last analyzed

Complexity

Total Complexity 18

Size/Duplication

Total Lines 174
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 18
lcom 1
cbo 1
dl 0
loc 174
rs 10
c 0
b 0
f 0

14 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getId() 0 4 1
A setId() 0 5 1
A getContaBancaria() 0 4 1
A setContaBancaria() 0 9 2
A getPagamentoStatus() 0 4 1
A setPagamentoStatus() 0 9 2
A getData() 0 4 1
A setData() 0 5 1
A getValor() 0 4 1
A setValor() 0 5 1
A getContaRecebimentoLancamentos() 0 4 1
A setContaRecebimentoLancamentos() 0 10 3
A jsonSerialize() 0 11 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: a.moreira
5
 * Date: 20/10/2016
6
 * Time: 10:49
7
 */
8
9
namespace Integracao\ControlPay\Model;
10
use Integracao\ControlPay\Helpers\SerializerHelper;
11
12
/**
13
 * Class Pagamento
14
 * @package Integracao\ControlPay\Model
15
 */
16
class Pagamento implements \JsonSerializable
17
{
18
    /**
19
     * @var integer
20
     */
21
    private $id;
22
23
    /**
24
     * @var ContaBancaria
25
     */
26
    private $contaBancaria;
27
28
    /**
29
     * @var PagamentoStatus
30
     */
31
    private $pagamentoStatus;
32
33
    /**
34
     * @var \DateTime
35
     */
36
    private $data;
37
38
    /**
39
     * @var double
40
     */
41
    private $valor;
42
43
    /**
44
     * @var array
45
     */
46
    private $contaRecebimentoLancamentos;
47
48
    /**
49
     * Pagamento constructor.
50
     */
51
    public function __construct()
52
    {
53
    }
54
55
    /**
56
     * @return int
57
     */
58
    public function getId()
59
    {
60
        return $this->id;
61
    }
62
63
    /**
64
     * @param int $id
65
     * @return Pagamento
66
     */
67
    public function setId($id)
68
    {
69
        $this->id = $id;
70
        return $this;
71
    }
72
73
    /**
74
     * @return Conta
75
     */
76
    public function getContaBancaria()
77
    {
78
        return $this->contaBancaria;
79
    }
80
81
    /**
82
     * @param Conta $contaBancaria
83
     * @return Pagamento
84
     */
85
    public function setContaBancaria($contaBancaria)
86
    {
87
        $this->contaBancaria = $contaBancaria;
0 ignored issues
show
Documentation Bug introduced by
It seems like $contaBancaria of type object<Integracao\ControlPay\Model\Conta> is incompatible with the declared type object<Integracao\ControlPay\Model\ContaBancaria> of property $contaBancaria.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
88
89
        if(is_array($this->contaBancaria))
90
            $this->contaBancaria = SerializerHelper::denormalize($this->contaBancaria, ContaBancaria::class);
91
92
        return $this;
93
    }
94
95
    /**
96
     * @return PagamentoStatus
97
     */
98
    public function getPagamentoStatus()
99
    {
100
        return $this->pagamentoStatus;
101
    }
102
103
    /**
104
     * @param PagamentoStatus $pagamentoStatus
105
     * @return Pagamento
106
     */
107
    public function setPagamentoStatus($pagamentoStatus)
108
    {
109
        $this->pagamentoStatus = $pagamentoStatus;
110
111
        if(is_array($this->pagamentoStatus))
112
            $this->pagamentoStatus = SerializerHelper::denormalize($this->pagamentoStatus, PagamentoStatus::class);
113
114
        return $this;
115
    }
116
117
    /**
118
     * @return \DateTime
119
     */
120
    public function getData()
121
    {
122
        return $this->data;
123
    }
124
125
    /**
126
     * @param \DateTime $data
127
     * @return Pagamento
128
     */
129
    public function setData($data)
130
    {
131
        $this->data = $data;
132
        return $this;
133
    }
134
135
    /**
136
     * @return float
137
     */
138
    public function getValor()
139
    {
140
        return $this->valor;
141
    }
142
143
    /**
144
     * @param float $valor
145
     * @return Pagamento
146
     */
147
    public function setValor($valor)
148
    {
149
        $this->valor = $valor;
150
        return $this;
151
    }
152
153
    /**
154
     * @return array
155
     */
156
    public function getContaRecebimentoLancamentos()
157
    {
158
        return $this->contaRecebimentoLancamentos;
159
    }
160
161
    /**
162
     * @param array $contaRecebimentoLancamentos
163
     * @return Pagamento
164
     */
165
    public function setContaRecebimentoLancamentos($contaRecebimentoLancamentos)
166
    {
167
        if(is_array($contaRecebimentoLancamentos))
168
            foreach ($contaRecebimentoLancamentos as $contaRecebimentoLancamento) {
169
                $this->contaRecebimentoLancamentos[] = SerializerHelper::denormalize(
170
                    $contaRecebimentoLancamento, ContaRecebimentoLancamento::class);
171
            }
172
173
        return $this;
174
    }
175
176
    function jsonSerialize()
177
    {
178
        return [
179
            'id' => $this->id,
180
            'contaBancaria' => $this->contaBancaria,
181
            'pagamentoStatus' => $this->pagamentoStatus,
182
            'data' => $this->data,
183
            'valor' => $this->valor,
184
            'contaRecebimentoLancamentos' => $this->contaRecebimentoLancamentos,
185
        ];
186
    }
187
188
189
}