Completed
Push — sf2.7 ( 8586ff...27ae11 )
by Laurent
03:38
created

InventoryArticles   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 235
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 16
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 235
rs 10

16 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setInventory() 0 6 1
A getInventory() 0 4 1
A setArticle() 0 6 1
A getArticle() 0 4 1
A setRealstock() 0 6 1
A getRealstock() 0 4 1
A setPrice() 0 6 1
A getPrice() 0 4 1
A setQuantity() 0 6 1
A getQuantity() 0 4 1
A setUnitStorage() 0 6 1
A getUnitStorage() 0 4 1
A __construct() 0 3 1
A setZoneStorage() 0 6 1
A getZoneStorage() 0 4 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Doctrine\Common\Collections\ArrayCollection;
7
8
/**
9
 * InventoryArticles
10
 *
11
 * @ORM\Table(name="gs_inventory_articles")
12
 * @ORM\Entity(repositoryClass="AppBundle\Entity\InventoryArticlesRepository")
13
 */
14
class InventoryArticles
15
{
16
    /**
17
     * @var integer
18
     *
19
     * @ORM\Column(name="id", type="integer")
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="AUTO")
22
     */
23
    private $id;
24
25
    /**
26
     * @var string
27
     *
28
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Inventory", inversedBy="articles")
29
     * @ORM\JoinColumn(nullable=false)
30
     */
31
    private $inventory;
32
33
    /**
34
     * @var string
35
     *
36
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Article")
37
     * @ORM\JoinColumn(nullable=false)
38
     */
39
    private $article;
40
41
    /**
42
     * @var decimal Quantité en stock
43
     *
44
     * @ORM\Column(name="quantity", type="decimal", precision=7, scale=3)
45
     */
46
    private $quantity;
47
48
    /**
49
     * @var string
50
     *
51
     * @ORM\Column(name="realstock", type="decimal", precision=7, scale=3, options={"default" = 0})
52
     */
53
    private $realstock;
54
55
    /**
56
     * @var string Unité de stockage
57
     *
58
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\UnitStorage")
59
     * @ORM\JoinColumn(nullable=false)
60
     */
61
    private $unit_storage;
62
63
    /**
64
     * @var string
65
     *
66
     * @ORM\Column(name="price", type="decimal", precision=7, scale=3, nullable=true)
67
     */
68
    private $price;
69
70
71
    /**
72
     * Get id
73
     *
74
     * @return integer 
75
     */
76
    public function getId()
77
    {
78
        return $this->id;
79
    }
80
81
    /**
82
     * Set inventory
83
     *
84
     * @param \AppBundle\Entity\Inventory $inventory
85
     * @return InventoryArticles
86
     */
87
    public function setInventory(\AppBundle\Entity\Inventory $inventory)
88
    {
89
        $this->inventory = $inventory;
0 ignored issues
show
Documentation Bug introduced by
It seems like $inventory of type object<AppBundle\Entity\Inventory> is incompatible with the declared type string of property $inventory.

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...
90
91
        return $this;
92
    }
93
94
    /**
95
     * Get inventory
96
     *
97
     * @return string 
98
     */
99
    public function getInventory()
100
    {
101
        return $this->inventory;
102
    }
103
104
    /**
105
     * Set article
106
     *
107
     * @param \AppBundle\Entity\Article $article
108
     * @return InventoryArticles
109
     */
110
    public function setArticle(\AppBundle\Entity\Article $article)
111
    {
112
        $this->article = $article;
0 ignored issues
show
Documentation Bug introduced by
It seems like $article of type object<AppBundle\Entity\Article> is incompatible with the declared type string of property $article.

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...
113
114
        return $this;
115
    }
116
117
    /**
118
     * Get article
119
     *
120
     * @return string 
121
     */
122
    public function getArticle()
123
    {
124
        return $this->article;
125
    }
126
127
    /**
128
     * Set realstock
129
     *
130
     * @param string $realstock
131
     * @return InventoryArticles
132
     */
133
    public function setRealstock($realstock)
134
    {
135
        $this->realstock = $realstock;
136
137
        return $this;
138
    }
139
140
    /**
141
     * Get realstock
142
     *
143
     * @return string 
144
     */
145
    public function getRealstock()
146
    {
147
        return $this->realstock;
148
    }
149
150
    /**
151
     * Set Price
152
     *
153
     * @param string $price
154
     * @return InventoryArticles
155
     */
156
    public function setPrice($price)
157
    {
158
        $this->price = $price;
159
160
        return $this;
161
    }
162
163
    /**
164
     * Get Price
165
     *
166
     * @return string 
167
     */
168
    public function getPrice()
169
    {
170
        return $this->price;
171
    }
172
173
    /**
174
     * Set quantity
175
     *
176
     * @param string $quantity
177
     * @return InventoryArticles
178
     */
179
    public function setQuantity($quantity)
180
    {
181
        $this->quantity = $quantity;
0 ignored issues
show
Documentation Bug introduced by
It seems like $quantity of type string is incompatible with the declared type object<AppBundle\Entity\decimal> of property $quantity.

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...
182
183
        return $this;
184
    }
185
186
    /**
187
     * Get quantity
188
     *
189
     * @return string 
190
     */
191
    public function getQuantity()
192
    {
193
        return $this->quantity;
194
    }
195
196
    /**
197
     * Set unit_storage
198
     *
199
     * @param \AppBundle\Entity\UnitStorage $unitStorage
200
     * @return InventoryArticles
201
     */
202
    public function setUnitStorage(\AppBundle\Entity\UnitStorage $unitStorage = null)
203
    {
204
        $this->unit_storage = $unitStorage;
0 ignored issues
show
Documentation Bug introduced by
It seems like $unitStorage can also be of type object<AppBundle\Entity\UnitStorage>. However, the property $unit_storage is declared as type string. 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...
205
206
        return $this;
207
    }
208
209
    /**
210
     * Get unit_storage
211
     *
212
     * @return \AppBundle\Entity\UnitStorage 
213
     */
214
    public function getUnitStorage()
215
    {
216
        return $this->unit_storage;
217
    }
218
219
    /**
220
     * Constructor
221
     */
222
    public function __construct()
223
    {
224
    }
225
226
    /**
227
     * Set zone_storage
228
     *
229
     * @param integer $zoneStorage
230
     * @return InventoryArticles
231
     */
232
    public function setZoneStorage($zoneStorage)
233
    {
234
        $this->zone_storage = $zoneStorage;
0 ignored issues
show
Bug introduced by
The property zone_storage does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
235
236
        return $this;
237
    }
238
239
    /**
240
     * Get zone_storage
241
     *
242
     * @return integer 
243
     */
244
    public function getZoneStorage()
245
    {
246
        return $this->zone_storage;
247
    }
248
}
249