| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 68 | */ |
||
| 69 | public function calculateSum(QuantityInterface $quantity) |
||
| 70 | { |
||
| 71 | $usage = $this->calculateUsage($quantity); |
||
| 72 | if ($usage === null) { |
||
| 73 | return null; |
||
| 74 | } |
||
| 75 | |||
| 76 | $price = $this->calculatePrice($quantity); |
||
| 77 | if ($price === null) { |
||
| 78 | return null; |
||
| 79 | } |
||
| 80 | |||
| 81 | return $price->multiply($usage->getQuantity()); |
||
| 82 | } |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @inheritdoc |
||
| 86 | */ |
||
| 94 |
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.