Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
33 | public function getEntity() |
||
34 | { |
||
35 | $unit = $this->unit->getEntity(); |
||
|
|||
36 | $currency = $this->currency->getEntity(); |
||
37 | |||
38 | return Entity::create([ |
||
39 | 'id' => $this->obj_id, |
||
40 | 'target' => $this->target->getEntity(), |
||
41 | 'type' => $this->type->getEntity(), |
||
42 | 'prepaid' => Quantity::create($unit, $this->quantity), |
||
43 | 'price' => new Money($this->price, $currency), |
||
44 | ]); |
||
45 | } |
||
46 | } |
||
47 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.