Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
68 | public function calculateCharge(ActionInterface $action) |
||
69 | { |
||
70 | if (!$action->isApplicable($this)) { |
||
71 | return null; |
||
72 | } |
||
73 | |||
74 | $usage = $this->calculateUsage($action->getQuantity()); |
||
75 | if ($usage === null) { |
||
76 | return null; |
||
77 | } |
||
78 | |||
79 | $sum = $this->calculateSum($action->getQuantity()); |
||
80 | if ($sum === null) { |
||
81 | return null; |
||
82 | } |
||
83 | |||
84 | return new Charge($action, $this->target, $this->type, $usage, $sum); |
||
85 | } |
||
86 | |||
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.