IntencaoVenda   F
last analyzed

Complexity

Total Complexity 90

Size/Duplication

Total Lines 903
Duplicated Lines 7.75 %

Coupling/Cohesion

Components 4
Dependencies 1

Importance

Changes 0
Metric Value
wmc 90
lcom 4
cbo 1
dl 70
loc 903
rs 1.697
c 0
b 0
f 0

70 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getId() 0 4 1
A setId() 0 5 1
A getPessoaVendedor() 0 4 1
A setPessoaVendedor() 9 9 2
A getPessoaCliente() 0 4 1
A setPessoaCliente() 0 9 2
A getFormaPagamento() 0 4 1
A setFormaPagamento() 0 9 2
A getTerminal() 0 4 1
A setTerminal() 0 9 2
A getPedido() 0 4 1
A setPedido() 0 9 2
A getOperador() 0 4 1
A setOperador() 9 9 2
A getContaRecebimentoLancamento() 0 4 1
A setContaRecebimentoLancamento() 0 9 2
A getPagamentoRecorrenteLancamento() 0 4 1
A setPagamentoRecorrenteLancamento() 0 9 2
A getIntencaoVendaStatus() 0 4 1
A setIntencaoVendaStatus() 0 9 2
A getReferencia() 0 4 1
A setReferencia() 0 5 1
A getToken() 0 4 1
A setToken() 0 5 1
A getData() 0 4 1
A setData() 0 13 3
A getValorOriginal() 0 4 1
A setValorOriginal() 0 5 1
A getValorAcrescimo() 0 4 1
A setValorAcrescimo() 0 5 1
A getValorDesconto() 0 4 1
A setValorDesconto() 0 5 1
A getValorFinal() 0 4 1
A setValorFinal() 0 5 1
A getLatitude() 0 4 1
A setLatitude() 0 5 1
A getLongitude() 0 4 1
A setLongitude() 0 5 1
A getGate2allToken() 0 4 1
A setGate2allToken() 0 5 1
A getCpfCnpj() 0 4 1
A setCpfCnpj() 0 5 1
A getObs() 0 4 1
A setObs() 0 5 1
A getItemProdutos() 0 4 1
A setItemProdutos() 12 12 3
A getPagamentosExterno() 0 4 1
A setPagamentosExterno() 10 10 3
A getProdutos() 0 4 1
A setProdutos() 11 11 3
A getHora() 0 4 1
A setHora() 0 5 1
A getQuantidade() 0 4 1
A setQuantidade() 0 5 1
A getValorOriginalFormat() 0 4 1
A setValorOriginalFormat() 0 5 1
A getValorDescontoFormat() 0 4 1
A setValorDescontoFormat() 0 5 1
A getValorAcrescimoFormat() 0 4 1
A setValorAcrescimoFormat() 0 5 1
A getValorFinalFormat() 0 4 1
A setValorFinalFormat() 0 5 1
A getVendedor() 0 4 1
A setVendedor() 9 9 2
A getCliente() 0 4 1
A setCliente() 0 5 1
A getPagamentosExternos() 0 4 1
A setPagamentosExternos() 10 10 3
A jsonSerialize() 0 35 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like IntencaoVenda often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use IntencaoVenda, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Integracao\ControlPay\Model;
4
use Integracao\ControlPay\Helpers\SerializerHelper;
5
6
/**
7
 * Class IntencaoVenda
8
 * @package Integracao\ControlPay\Model
9
 */
10
class IntencaoVenda implements \JsonSerializable
11
{
12
    /**
13
     * @var integer
14
     */
15
    private $id;
16
17
    /**
18
     * @var Pessoa
19
     */
20
    private $pessoaVendedor;
21
22
    /**
23
     * @var Pessoa
24
     */
25
    private $pessoaCliente;
26
27
    /**
28
     * @var Pessoa
29
     */
30
    private $cliente;
31
32
    /**
33
     * @var FormaPagamento
34
     */
35
    private $formaPagamento;
36
37
    /**
38
     * @var Terminal
39
     */
40
    private $terminal;
41
42
    /**
43
     * @var Pedido
44
     */
45
    private $pedido;
46
47
    /**
48
     * @var Operador
49
     */
50
    private $operador;
51
52
    /**
53
     * @var ContaRecebimentoLancamento
54
     */
55
    private $contaRecebimentoLancamento;
56
57
    /**
58
     * @var PagamentoRecorrenteLancamento
59
     */
60
    private $pagamentoRecorrenteLancamento;
61
62
    /**
63
     * @var IntencaoVendaStatus
64
     */
65
    private $intencaoVendaStatus;
66
67
    /**
68
     * @var string
69
     */
70
    private $referencia;
71
72
    /**
73
     * @var string
74
     */
75
    private $token;
76
77
    /**
78
     * @var \DateTime
79
     */
80
    private $data;
81
82
    /**
83
     * @var string
84
     */
85
    private $hora;
86
87
    /**
88
     * @var double
89
     */
90
    private $valorOriginal;
91
92
    /**
93
     * @var double
94
     */
95
    private $valorAcrescimo;
96
97
    /**
98
     * @var double
99
     */
100
    private $valorDesconto;
101
102
    /**
103
     * @var double
104
     */
105
    private $valorFinal;
106
107
    /**
108
     * @var string
109
     */
110
    private $valorOriginalFormat;
111
112
    /**
113
     * @var string
114
     */
115
    private $valorDescontoFormat;
116
117
    /**
118
     * @var string
119
     */
120
    private $valorAcrescimoFormat;
121
122
    /**
123
     * @var string
124
     */
125
    private $valorFinalFormat;
126
127
    /**
128
     * @var float
129
     */
130
    private $latitude;
131
132
    /**
133
     * @var float
134
     */
135
    private $longitude;
136
137
    /**
138
     * @var string
139
     */
140
    private $gate2allToken;
141
142
    /**
143
     * @var string
144
     */
145
    private $cpfCnpj;
146
147
    /**
148
     * @var string
149
     */
150
    private $obs;
151
152
    /**
153
     * @var integer
154
     */
155
    private $quantidade;
156
157
    /**
158
     * @var array
159
     */
160
    private $itemProdutos;
161
162
    /**
163
     * @var array
164
     */
165
    private $produtos;
166
167
    /**
168
     * @var array
169
     */
170
    private $pagamentosExterno;
171
172
    /**
173
     * @var array
174
     */
175
    private $pagamentosExternos;
176
177
    /**
178
     * @var Pessoa
179
     */
180
    private $vendedor;
181
182
    /**
183
     * IntencaoVenda constructor.
184
     */
185
    public function __construct()
186
    {
187
    }
188
189
    /**
190
     * @return mixed
191
     */
192
    public function getId()
193
    {
194
        return $this->id;
195
    }
196
197
    /**
198
     * @param mixed $id
199
     * @return IntencaoVenda
200
     */
201
    public function setId($id)
202
    {
203
        $this->id = $id;
204
        return $this;
205
    }
206
207
    /**
208
     * @return Pessoa
209
     */
210
    public function getPessoaVendedor()
211
    {
212
        return $this->pessoaVendedor;
213
    }
214
215
    /**
216
     * @param Pessoa $pessoaVendedor
217
     * @return IntencaoVenda
218
     */
219 View Code Duplication
    public function setPessoaVendedor($pessoaVendedor)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
220
    {
221
        $this->pessoaVendedor = $pessoaVendedor;
222
223
        if(is_array($this->pessoaVendedor))
224
            $this->pessoaVendedor = SerializerHelper::denormalize($this->pessoaVendedor, Pessoa::class);
225
226
        return $this;
227
    }
228
229
    /**
230
     * @return Pessoa
231
     */
232
    public function getPessoaCliente()
233
    {
234
        return $this->pessoaCliente;
235
    }
236
237
    /**
238
     * @param Pessoa $pessoaCliente
239
     * @return IntencaoVenda
240
     */
241
    public function setPessoaCliente($pessoaCliente)
242
    {
243
        $this->pessoaCliente = $pessoaCliente;
244
245
        if(is_array($this->pessoaCliente))
246
            $this->pessoaCliente = SerializerHelper::denormalize($this->pessoaCliente, Pessoa::class);
247
248
        return $this;
249
    }
250
251
    /**
252
     * @return FormaPagamento
253
     */
254
    public function getFormaPagamento()
255
    {
256
        return $this->formaPagamento;
257
    }
258
259
    /**
260
     * @param FormaPagamento $formaPagamento
261
     * @return IntencaoVenda
262
     */
263
    public function setFormaPagamento($formaPagamento)
264
    {
265
        $this->formaPagamento = $formaPagamento;
266
267
        if(is_array($this->formaPagamento))
268
            $this->formaPagamento = SerializerHelper::denormalize($this->formaPagamento, FormaPagamento::class);
269
270
        return $this;
271
    }
272
273
    /**
274
     * @return Terminal
275
     */
276
    public function getTerminal()
277
    {
278
        return $this->terminal;
279
    }
280
281
    /**
282
     * @param Terminal $terminal
283
     * @return IntencaoVenda
284
     */
285
    public function setTerminal($terminal)
286
    {
287
        $this->terminal = $terminal;
288
289
        if(is_array($this->terminal))
290
            $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class);
291
292
        return $this;
293
    }
294
295
    /**
296
     * @return Pedido
297
     */
298
    public function getPedido()
299
    {
300
        return $this->pedido;
301
    }
302
303
    /**
304
     * @param Pedido $pedido
305
     * @return IntencaoVenda
306
     */
307
    public function setPedido($pedido)
308
    {
309
        $this->pedido = $pedido;
310
311
        if(is_array($this->pedido))
312
            $this->pedido = SerializerHelper::denormalize($this->pedido, Pedido::class);
313
314
        return $this;
315
    }
316
317
    /**
318
     * @return Operador
319
     */
320
    public function getOperador()
321
    {
322
        return $this->operador;
323
    }
324
325
    /**
326
     * @param Operador $operador
327
     * @return IntencaoVenda
328
     */
329 View Code Duplication
    public function setOperador($operador)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
330
    {
331
        $this->operador = $operador;
332
333
        if(is_array($this->operador))
334
            $this->operador = SerializerHelper::denormalize($this->operador, Operador::class);
335
336
        return $this;
337
    }
338
339
    /**
340
     * @return ContaRecebimentoLancamento
341
     */
342
    public function getContaRecebimentoLancamento()
343
    {
344
        return $this->contaRecebimentoLancamento;
345
    }
346
347
    /**
348
     * @param ContaRecebimentoLancamento $contaRecebimentoLancamento
349
     * @return IntencaoVenda
350
     */
351
    public function setContaRecebimentoLancamento($contaRecebimentoLancamento)
352
    {
353
        $this->contaRecebimentoLancamento = $contaRecebimentoLancamento;
354
355
        if(is_array($this->contaRecebimentoLancamento))
356
            $this->contaRecebimentoLancamento = SerializerHelper::denormalize($this->contaRecebimentoLancamento, ContaRecebimentoLancamento::class);
357
358
        return $this;
359
    }
360
361
    /**
362
     * @return PagamentoRecorrenteLancamento
363
     */
364
    public function getPagamentoRecorrenteLancamento()
365
    {
366
        return $this->pagamentoRecorrenteLancamento;
367
    }
368
369
    /**
370
     * @param PagamentoRecorrenteLancamento $pagamentoRecorrenteLancamento
371
     * @return IntencaoVenda
372
     */
373
    public function setPagamentoRecorrenteLancamento($pagamentoRecorrenteLancamento)
374
    {
375
        $this->pagamentoRecorrenteLancamento = $pagamentoRecorrenteLancamento;
376
377
        if(is_array($this->pagamentoRecorrenteLancamento))
378
            $this->pagamentoRecorrenteLancamento = SerializerHelper::denormalize($this->pagamentoRecorrenteLancamento, PagamentoRecorrenteLancamento::class);
379
380
        return $this;
381
    }
382
383
    /**
384
     * @return IntencaoVendaStatus
385
     */
386
    public function getIntencaoVendaStatus()
387
    {
388
        return $this->intencaoVendaStatus;
389
    }
390
391
    /**
392
     * @param IntencaoVendaStatus $intencaoVendaStatus
393
     * @return IntencaoVenda
394
     */
395
    public function setIntencaoVendaStatus($intencaoVendaStatus)
396
    {
397
        $this->intencaoVendaStatus = $intencaoVendaStatus;
398
399
        if(is_array($this->intencaoVendaStatus))
400
            $this->intencaoVendaStatus = SerializerHelper::denormalize($this->intencaoVendaStatus, IntencaoVendaStatus::class);
401
402
        return $this;
403
    }
404
405
    /**
406
     * @return string
407
     */
408
    public function getReferencia()
409
    {
410
        return $this->referencia;
411
    }
412
413
    /**
414
     * @param string $referencia
415
     * @return IntencaoVenda
416
     */
417
    public function setReferencia($referencia)
418
    {
419
        $this->referencia = $referencia;
420
        return $this;
421
    }
422
423
    /**
424
     * @return string
425
     */
426
    public function getToken()
427
    {
428
        return $this->token;
429
    }
430
431
    /**
432
     * @param string $token
433
     * @return IntencaoVenda
434
     */
435
    public function setToken($token)
436
    {
437
        $this->token = $token;
438
        return $this;
439
    }
440
441
    /**
442
     * @return \DateTime
443
     */
444
    public function getData()
445
    {
446
        return $this->data;
447
    }
448
449
    /**
450
     * @param \DateTime $data
451
     * @return IntencaoVenda
452
     */
453
    public function setData($data)
454
    {
455
456
        $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data);
0 ignored issues
show
Documentation Bug introduced by
It seems like \DateTime::createFromFor...'d/m/Y H:i:s.u', $data) can also be of type false. However, the property $data is declared as type object<DateTime>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
457
458
        if(empty($this->data))
459
            $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data);
0 ignored issues
show
Documentation Bug introduced by
It seems like \DateTime::createFromFormat('d/m/Y H:i:s', $data) can also be of type false. However, the property $data is declared as type object<DateTime>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
460
461
        if(empty($this->data))
462
            $this->data = \DateTime::createFromFormat('d/m/Y H:i', $data);
0 ignored issues
show
Documentation Bug introduced by
It seems like \DateTime::createFromFormat('d/m/Y H:i', $data) can also be of type false. However, the property $data is declared as type object<DateTime>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
463
464
        return $this;
465
    }
466
467
    /**
468
     * @return float
469
     */
470
    public function getValorOriginal()
471
    {
472
        return $this->valorOriginal;
473
    }
474
475
    /**
476
     * @param float $valorOriginal
477
     * @return IntencaoVenda
478
     */
479
    public function setValorOriginal($valorOriginal)
480
    {
481
        $this->valorOriginal = $valorOriginal;
482
        return $this;
483
    }
484
485
    /**
486
     * @return float
487
     */
488
    public function getValorAcrescimo()
489
    {
490
        return $this->valorAcrescimo;
491
    }
492
493
    /**
494
     * @param float $valorAcrescimo
495
     * @return IntencaoVenda
496
     */
497
    public function setValorAcrescimo($valorAcrescimo)
498
    {
499
        $this->valorAcrescimo = $valorAcrescimo;
500
        return $this;
501
    }
502
503
    /**
504
     * @return float
505
     */
506
    public function getValorDesconto()
507
    {
508
        return $this->valorDesconto;
509
    }
510
511
    /**
512
     * @param float $valorDesconto
513
     * @return IntencaoVenda
514
     */
515
    public function setValorDesconto($valorDesconto)
516
    {
517
        $this->valorDesconto = $valorDesconto;
518
        return $this;
519
    }
520
521
    /**
522
     * @return float
523
     */
524
    public function getValorFinal()
525
    {
526
        return $this->valorFinal;
527
    }
528
529
    /**
530
     * @param float $valorFinal
531
     * @return IntencaoVenda
532
     */
533
    public function setValorFinal($valorFinal)
534
    {
535
        $this->valorFinal = $valorFinal;
536
        return $this;
537
    }
538
539
    /**
540
     * @return float
541
     */
542
    public function getLatitude()
543
    {
544
        return $this->latitude;
545
    }
546
547
    /**
548
     * @param float $latitude
549
     * @return IntencaoVenda
550
     */
551
    public function setLatitude($latitude)
552
    {
553
        $this->latitude = $latitude;
554
        return $this;
555
    }
556
557
    /**
558
     * @return float
559
     */
560
    public function getLongitude()
561
    {
562
        return $this->longitude;
563
    }
564
565
    /**
566
     * @param float $longitude
567
     * @return IntencaoVenda
568
     */
569
    public function setLongitude($longitude)
570
    {
571
        $this->longitude = $longitude;
572
        return $this;
573
    }
574
575
    /**
576
     * @return string
577
     */
578
    public function getGate2allToken()
579
    {
580
        return $this->gate2allToken;
581
    }
582
583
    /**
584
     * @param string $gate2allToken
585
     * @return IntencaoVenda
586
     */
587
    public function setGate2allToken($gate2allToken)
588
    {
589
        $this->gate2allToken = $gate2allToken;
590
        return $this;
591
    }
592
593
    /**
594
     * @return string
595
     */
596
    public function getCpfCnpj()
597
    {
598
        return $this->cpfCnpj;
599
    }
600
601
    /**
602
     * @param string $cpfCnpj
603
     * @return IntencaoVenda
604
     */
605
    public function setCpfCnpj($cpfCnpj)
606
    {
607
        $this->cpfCnpj = $cpfCnpj;
608
        return $this;
609
    }
610
611
    /**
612
     * @return string
613
     */
614
    public function getObs()
615
    {
616
        return $this->obs;
617
    }
618
619
    /**
620
     * @param string $obs
621
     * @return IntencaoVenda
622
     */
623
    public function setObs($obs)
624
    {
625
        $this->obs = $obs;
626
        return $this;
627
    }
628
629
    /**
630
     * @return array
631
     */
632
    public function getItemProdutos()
633
    {
634
        return $this->itemProdutos;
635
    }
636
637
    /**
638
     * @param array $itemProdutos
639
     * @return IntencaoVenda
640
     */
641 View Code Duplication
    public function setItemProdutos($itemProdutos)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
642
    {
643
        //$this->itemProdutos = $itemProdutos;
644
645
        if(is_array($itemProdutos))
646
            foreach ($itemProdutos as $itemProduto) {
647
                $this->itemProdutos[] = SerializerHelper::denormalize(
648
                    $itemProduto, ItemProduto::class);
649
            }
650
651
        return $this;
652
    }
653
654
    /**
655
     * @return array
656
     */
657
    public function getPagamentosExterno()
658
    {
659
        return $this->pagamentosExterno;
660
    }
661
662
    /**
663
     * @param array $pagamentosExterno
664
     * @return IntencaoVenda
665
     */
666 View Code Duplication
    public function setPagamentosExterno($pagamentosExterno)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
667
    {
668
        if(is_array($pagamentosExterno))
669
            foreach ($pagamentosExterno as $pagamentoExterno) {
670
                $this->pagamentosExterno[] = SerializerHelper::denormalize(
671
                    $pagamentoExterno, PagamentoExterno::class);
672
            }
673
674
        return $this;
675
    }
676
677
    /**
678
     * @return array
679
     */
680
    public function getProdutos()
681
    {
682
        return $this->produtos;
683
    }
684
685
    /**
686
     * @param array $produtos
687
     * @return IntencaoVenda
688
     */
689 View Code Duplication
    public function setProdutos($produtos)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
690
    {
691
692
        if(is_array($produtos))
693
            foreach ($produtos as $produto) {
694
                $this->produtos[] = SerializerHelper::denormalize(
695
                    $produto, ItemProduto::class);
696
            }
697
698
        return $this;
699
    }
700
701
    /**
702
     * @return string
703
     */
704
    public function getHora()
705
    {
706
        return $this->hora;
707
    }
708
709
    /**
710
     * @param string $hora
711
     * @return IntencaoVenda
712
     */
713
    public function setHora($hora)
714
    {
715
        $this->hora = $hora;
716
        return $this;
717
    }
718
719
    /**
720
     * @return int
721
     */
722
    public function getQuantidade()
723
    {
724
        return $this->quantidade;
725
    }
726
727
    /**
728
     * @param int $quantidade
729
     * @return IntencaoVenda
730
     */
731
    public function setQuantidade($quantidade)
732
    {
733
        $this->quantidade = $quantidade;
734
        return $this;
735
    }
736
737
    /**
738
     * @return string
739
     */
740
    public function getValorOriginalFormat()
741
    {
742
        return $this->valorOriginalFormat;
743
    }
744
745
    /**
746
     * @param string $valorOriginalFormat
747
     * @return IntencaoVenda
748
     */
749
    public function setValorOriginalFormat($valorOriginalFormat)
750
    {
751
        $this->valorOriginalFormat = $valorOriginalFormat;
752
        return $this;
753
    }
754
755
    /**
756
     * @return string
757
     */
758
    public function getValorDescontoFormat()
759
    {
760
        return $this->valorDescontoFormat;
761
    }
762
763
    /**
764
     * @param string $valorDescontoFormat
765
     * @return IntencaoVenda
766
     */
767
    public function setValorDescontoFormat($valorDescontoFormat)
768
    {
769
        $this->valorDescontoFormat = $valorDescontoFormat;
770
        return $this;
771
    }
772
773
    /**
774
     * @return string
775
     */
776
    public function getValorAcrescimoFormat()
777
    {
778
        return $this->valorAcrescimoFormat;
779
    }
780
781
    /**
782
     * @param string $valorAcrescimoFormat
783
     * @return IntencaoVenda
784
     */
785
    public function setValorAcrescimoFormat($valorAcrescimoFormat)
786
    {
787
        $this->valorAcrescimoFormat = $valorAcrescimoFormat;
788
        return $this;
789
    }
790
791
    /**
792
     * @return string
793
     */
794
    public function getValorFinalFormat()
795
    {
796
        return $this->valorFinalFormat;
797
    }
798
799
    /**
800
     * @param string $valorFinalFormat
801
     * @return IntencaoVenda
802
     */
803
    public function setValorFinalFormat($valorFinalFormat)
804
    {
805
        $this->valorFinalFormat = $valorFinalFormat;
806
        return $this;
807
    }
808
809
    /**
810
     * @return Pessoa
811
     */
812
    public function getVendedor()
813
    {
814
        return $this->vendedor;
815
    }
816
817
    /**
818
     * @param Pessoa $vendedor
819
     * @return IntencaoVenda
820
     */
821 View Code Duplication
    public function setVendedor($vendedor)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
822
    {
823
        $this->vendedor = $vendedor;
824
825
        if(is_array($this->vendedor))
826
            $this->vendedor = SerializerHelper::denormalize($this->pessoaVendedor, Pessoa::class);
827
828
        return $this;
829
    }
830
831
    /**
832
     * @return Pessoa
833
     */
834
    public function getCliente()
835
    {
836
        return $this->cliente;
837
    }
838
839
    /**
840
     * @param Pessoa $cliente
841
     * @return IntencaoVenda
842
     */
843
    public function setCliente($cliente)
844
    {
845
        $this->cliente = $cliente;
846
        return $this;
847
    }
848
849
    /**
850
     * @return array
851
     */
852
    public function getPagamentosExternos()
853
    {
854
        return $this->pagamentosExternos;
855
    }
856
857
    /**
858
     * @param array $pagamentosExternos
859
     * @return IntencaoVenda
860
     */
861 View Code Duplication
    public function setPagamentosExternos($pagamentosExternos)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
862
    {
863
        if(is_array($pagamentosExternos))
864
            foreach ($pagamentosExternos as $pagamentoExterno) {
865
                $this->pagamentosExternos[] = SerializerHelper::denormalize(
866
                    $pagamentoExterno, PagamentoExterno::class);
867
            }
868
869
        return $this;
870
    }
871
872
    /**
873
     * @return array
874
     */
875
    function jsonSerialize()
876
    {
877
        return [
878
            'id' => $this->id,
879
            'pessoaVendedor' => $this->pessoaVendedor,
880
            'pessoaCliente' => $this->pessoaCliente,
881
            'itemProdutos' => $this->itemProdutos,
882
            'pagamentosExterno' => $this->pagamentosExterno,
883
            'produtos' => $this->produtos,
884
            'contaRecebimentoLancamento' => $this->contaRecebimentoLancamento,
885
            'cpfCnpj' => $this->cpfCnpj,
886
            'data' => $this->data,
887
            'formaPagamento' => $this->formaPagamento,
888
            'gate2allToken' => $this->gate2allToken,
889
            'referencia' => $this->referencia,
890
            'intencaoVendaStatus' => $this->intencaoVendaStatus,
891
            'longitude' => $this->longitude,
892
            'latitude' => $this->latitude,
893
            'obs' => $this->obs,
894
            'pedido' => $this->pedido,
895
            'quantidade' => $this->quantidade,
896
            'vendedor' => $this->vendedor,
897
            'terminal' => $this->terminal,
898
            'hora' => $this->hora,
899
            'cliente' => $this->cliente,
900
            'valorOriginal' => $this->valorOriginal,
901
            'valorOriginalFormat' => $this->valorOriginalFormat,
902
            'valorAcrescimo' => $this->valorAcrescimo,
903
            'valorAcrescimoFormat' => $this->valorAcrescimoFormat,
904
            'valorDesconto' => $this->valorDesconto,
905
            'valorDescontoFormat' => $this->valorDescontoFormat,
906
            'valorFinal' => $this->valorFinal,
907
            'valorFinalFormat' => $this->valorFinalFormat,
908
        ];
909
    }
910
911
912
}