Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.2098 |
Changes | 0 |
1 | <?php |
||
70 | public function calculateSum(QuantityInterface $quantity) |
||
71 | 1 | { |
|
72 | 1 | $usage = $this->calculateUsage($quantity); |
|
73 | if ($usage === null) { |
||
74 | return null; |
||
75 | } |
||
76 | 1 | ||
77 | 1 | $price = $this->calculatePrice($quantity); |
|
78 | if ($price === null) { |
||
79 | return null; |
||
80 | } |
||
81 | 1 | ||
82 | return $price->multiply($usage->getQuantity()); |
||
83 | } |
||
84 | |||
100 |
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 given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.