InsertRequest::setNome()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Integracao\ControlPay\Contracts\Terminal;
4
5
use Integracao\ControlPay\Helpers\SerializerHelper;
6
use Integracao\ControlPay\Model\Impressora;
7
use Integracao\ControlPay\Model\Pessoa;
8
use Integracao\ControlPay\Model\Terminal;
9
10
/**
11
 * Class InsertRequest
12
 * @package Integracao\ControlPay\Contracts\Produto
13
 */
14 View Code Duplication
class InsertRequest implements \JsonSerializable
0 ignored issues
show
Duplication introduced by
This class 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...
15
{
16
    /**
17
     * @var integer
18
     */
19
    private $id;
20
21
    /**
22
     * @var string
23
     */
24
    private $nome;
25
26
    /**
27
     * @var string
28
     */
29
    private $impressora;
30
31
    /**
32
     * @var Pessoa
33
     */
34
    private $pessoa;
35
36
    /**
37
     * FluxoPagamento constructor.
38
     */
39
    public function __construct()
40
    {
41
    }
42
43
    /**
44
     * @return int
45
     */
46
    public function getId()
47
    {
48
        return $this->id;
49
    }
50
51
    /**
52
     * @param int $id
53
     * @return FluxoPagamento
54
     */
55
    public function setId($id)
56
    {
57
        $this->id = $id;
58
        return $this;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getNome()
65
    {
66
        return $this->nome;
67
    }
68
69
    /**
70
     * @param string $nome
71
     * @return FluxoPagamento
72
     */
73
    public function setNome($nome)
74
    {
75
        $this->nome = $nome;
76
        return $this;
77
    }
78
79
    /**
80
     * @return string
81
     */
82
    public function getImpressora()
83
    {
84
        return $this->impressora;
85
    }
86
87
    /**
88
     * @param string $impressora
89
     * @return Terminal
90
     */
91
    public function setImpressora($impressora)
92
    {
93
        $this->impressora = $impressora;
94
95
        if(is_array($this->impressora))
96
            $this->impressora = SerializerHelper::denormalize($this->impressora, Impressora::class);
0 ignored issues
show
Documentation Bug introduced by
It seems like \Integracao\ControlPay\H...odel\Impressora::class) of type object is incompatible with the declared type string of property $impressora.

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...
97
98
        return $this;
99
    }
100
101
    /**
102
     * @return Pessoa
103
     */
104
    public function getPessoa()
105
    {
106
        return $this->pessoa;
107
    }
108
109
    /**
110
     * @param Pessoa $pessoa
111
     * @return Terminal
112
     */
113
    public function setPessoa($pessoa)
114
    {
115
        $this->pessoa = $pessoa;
116
117
        if(is_array($this->pessoa))
118
            $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class);
119
120
        return $this;
121
    }
122
123
    function jsonSerialize()
124
    {
125
        return [
126
            'id' => $this->id,
127
            'nome' => $this->nome,
128
            'impressora' => $this->impressora,
129
            'pessoa' => $this->pessoa,
130
        ];
131
    }
132
133
}