Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function generate(OrderInterface $order, PartialRefundItems $partialRefundItems): PartialRefundItems |
||
22 | { |
||
23 | $units = $order->getItemUnits(); |
||
24 | |||
25 | foreach ($units as $unit) { |
||
26 | if ($partialRefundItem = $partialRefundItems->findById($unit->getId())) { |
||
|
|||
27 | $partialRefundItem->setAmountTotal($unit->getTotal()); |
||
28 | |||
29 | continue; |
||
30 | } |
||
31 | |||
32 | $partialRefundItem = new PartialRefundItem(); |
||
33 | |||
34 | $partialRefundItem->setId($unit->getId()); |
||
35 | $partialRefundItem->setAmountRefunded(0); |
||
36 | $partialRefundItem->setAmountTotal($unit->getTotal()); |
||
37 | |||
38 | $partialRefundItems->setPartialRefundItems($partialRefundItem); |
||
39 | } |
||
40 | |||
41 | return $partialRefundItems; |
||
42 | } |
||
44 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.