Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
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 | |||
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.