Passed
Push — master ( 3f8050...70788f )
by Luiz Kim
05:05 queued 02:57
created

PeopleLink::setPeople()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
use ApiPlatform\Core\Annotation\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\ApiResource was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Symfony\Component\Serializer\Annotation\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Annotation\Groups was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Doctrine\Common\Collections\ArrayCollection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Doctrine\Common\Collections\Collection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\Collection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
/**
12
 * @ORM\Table(name="people_people", uniqueConstraints={@ORM\UniqueConstraint(name="people_id", columns={"people_id", "people_company"})}, indexes={@ORM\Index(name="people_company_id", columns={"people_company"})})
13
 * @ORM\Entity(repositoryClass="ControleOnline\Repository\PeopleLinkRepository")
14
 * @ORM\EntityListeners({App\Listener\LogListener::class}) 
15
 */
16
class PeopleLink
17
{
18
    /**
19
     *
20
     * @ORM\Column(type="integer", nullable=false)
21
     * @ORM\Id
22
     * @ORM\GeneratedValue(strategy="IDENTITY")
23
     */
24
    private $id;
25
26
    /**
27
     * @var \ControleOnline\Entity\People
28
     *
29
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People", inversedBy="peoplePeopleCompany")
30
     * @ORM\JoinColumns({
31
     *   @ORM\JoinColumn(name="people_company_id", referencedColumnName="id")
32
     * })
33
     */
34
    private $people_company;
35
36
    /**
37
     * @var \ControleOnline\Entity\People
38
     *
39
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People", inversedBy="peoplePeople")
40
     * @ORM\JoinColumns({
41
     *   @ORM\JoinColumn(name="people_id", referencedColumnName="id")
42
     * })
43
     */
44
    private $people;
45
46
    /**
47
     *
48
     * @ORM\Column(type="boolean",  nullable=false)
49
     */
50
    private $enable = 0;
51
52
53
    /**
54
     * @var string
55
     * 
56
     *
57
     * @ORM\Column(name="link_type", type="string", columnDefinition="ENUM('employee','client','provider','franchisee')", nullable=false)
58
     */
59
    private $link_type;
60
61
62
    /**
63
     * @var float
64
     *
65
     * @ORM\Column(name="comission", type="float", nullable=false)
66
     */
67
    private $comission;
68
69
70
    /**
71
     * @var float
72
     *
73
     * @ORM\Column(name="minimum_comission", type="float", nullable=false)
74
     */
75
    private $minimum_comission;
76
77
    public function getId()
78
    {
79
        return $this->id;
80
    }
81
82
    public function setPeopleCompany(People $people_company = null)
83
    {
84
        $this->people_company = $people_company;
85
86
        return $this;
87
    }
88
89
    public function getPeopleCompany()
90
    {
91
        return $this->people_company;
92
    }
93
94
    public function setPeople(People $people = null)
95
    {
96
        $this->people = $people;
97
98
        return $this;
99
    }
100
101
    public function getPeople()
102
    {
103
        return $this->people;
104
    }
105
106
    public function getEnabled()
107
    {
108
        return $this->enable;
109
    }
110
111
    public function setEnabled($enable)
112
    {
113
        $this->enable = $enable ?: 0;
0 ignored issues
show
Documentation Bug introduced by
It seems like $enable ?: 0 can also be of type integer. However, the property $enable is declared as type boolean. 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...
114
115
        return $this;
116
    }
117
118
119
    /**
120
     * Set minimum_comission
121
     *
122
     * @param float $minimum_comission
123
     * @return PeopleSalesman
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\PeopleSalesman was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
124
     */
125
    public function setMinimumComission($minimum_comission): self
126
    {
127
        $this->minimum_comission = $minimum_comission;
128
129
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type ControleOnline\Entity\PeopleLink which is incompatible with the documented return type ControleOnline\Entity\PeopleSalesman.
Loading history...
130
    }
131
132
    /**
133
     * Get minimum_comission
134
     *
135
     * @return float
136
     */
137
    public function getMinimumComission(): float
138
    {
139
        return $this->minimum_comission;
140
    }
141
142
143
    /**
144
     * Set comission
145
     *
146
     * @param float $comission
147
     * @return PeopleSalesman
148
     */
149
    public function setComission($comission): self
150
    {
151
        $this->comission = $comission;
152
153
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type ControleOnline\Entity\PeopleLink which is incompatible with the documented return type ControleOnline\Entity\PeopleSalesman.
Loading history...
154
    }
155
156
    /**
157
     * Get comission
158
     *
159
     * @return float
160
     */
161
    public function getComission(): float
162
    {
163
        return $this->comission;
164
    }
165
166
    /**
167
     * Get the value of link_type
168
     */
169
    public function getLinkType()
170
    {
171
        return $this->link_type;
172
    }
173
174
    /**
175
     * Set the value of link_type
176
     */
177
    public function setLinkType($link_type): self
178
    {
179
        $this->link_type = $link_type;
180
181
        return $this;
182
    }
183
}
184