Terminal::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\Model;
4
use Integracao\ControlPay\Helpers\SerializerHelper;
5
6
/**
7
 * Class Terminal
8
 * @package Integracao\ControlPay\Model
9
 */
10 View Code Duplication
class Terminal 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...
11
{
12
    /**
13
     * @var integer
14
     */
15
    private $id;
16
17
    /**
18
     * @var string
19
     */
20
    private $nome;
21
22
    /**
23
     * @var string
24
     */
25
    private $impressora;
26
27
    /**
28
     * @var Pessoa
29
     */
30
    private $pessoa;
31
32
    /**
33
     * FluxoPagamento constructor.
34
     */
35
    public function __construct()
36
    {
37
    }
38
39
    /**
40
     * @return int
41
     */
42
    public function getId()
43
    {
44
        return $this->id;
45
    }
46
47
    /**
48
     * @param int $id
49
     * @return FluxoPagamento
50
     */
51
    public function setId($id)
52
    {
53
        $this->id = $id;
54
        return $this;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getNome()
61
    {
62
        return $this->nome;
63
    }
64
65
    /**
66
     * @param string $nome
67
     * @return FluxoPagamento
68
     */
69
    public function setNome($nome)
70
    {
71
        $this->nome = $nome;
72
        return $this;
73
    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getImpressora()
79
    {
80
        return $this->impressora;
81
    }
82
83
    /**
84
     * @param string $impressora
85
     * @return Terminal
86
     */
87
    public function setImpressora($impressora)
88
    {
89
        $this->impressora = $impressora;
90
91
        if(is_array($this->impressora))
92
            $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...
93
94
        return $this;
95
    }
96
97
    /**
98
     * @return Pessoa
99
     */
100
    public function getPessoa()
101
    {
102
        return $this->pessoa;
103
    }
104
105
    /**
106
     * @param Pessoa $pessoa
107
     * @return Terminal
108
     */
109
    public function setPessoa($pessoa)
110
    {
111
        $this->pessoa = $pessoa;
112
113
        if(is_array($this->pessoa))
114
            $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class);
115
116
        return $this;
117
    }
118
119
    function jsonSerialize()
120
    {
121
        return [
122
            'id' => $this->id,
123
            'nome' => $this->nome,
124
            'impressora' => $this->impressora,
125
            'pessoa' => $this->pessoa,
126
        ];
127
    }
128
}