| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 91 | public function calculateSum(QuantityInterface $quantity) |
||
| 92 | { |
||
| 93 | $usage = $this->calculateUsage($quantity); |
||
| 94 | if ($usage === null) { |
||
| 95 | return null; |
||
| 96 | } |
||
| 97 | |||
| 98 | $price = $this->calculatePrice($quantity); |
||
| 99 | if ($price === null) { |
||
| 100 | return null; |
||
| 101 | } |
||
| 102 | |||
| 103 | return $price->multiply($usage->getQuantity()); |
||
| 104 | } |
||
| 105 | |||
| 116 |
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.