Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.1406 |
Changes | 0 |
1 | <?php |
||
65 | 1 | public function calculateSum(QuantityInterface $quantity) |
|
66 | { |
||
67 | 1 | $usage = $this->calculateUsage($quantity); |
|
68 | 1 | if ($usage === null) { |
|
69 | return null; |
||
70 | } |
||
71 | |||
72 | 1 | $price = $this->calculatePrice($quantity); |
|
73 | 1 | if ($price === null) { |
|
74 | return null; |
||
75 | } |
||
76 | |||
77 | 1 | return $price->multiply($usage->getQuantity()); |
|
78 | } |
||
79 | |||
104 |
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.