@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | //If no array object is existing yet, create the array |
86 | - if(!isset($grouped[$bank_account])) { |
|
86 | + if (!isset($grouped[$bank_account])) { |
|
87 | 87 | $grouped[$bank_account] = []; |
88 | 88 | } |
89 | 89 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | //Limit the sum amount of each group |
129 | 129 | $groups_exceeding_limit = $tmp; |
130 | 130 | $output = []; |
131 | - while(!empty($groups_exceeding_limit)) { |
|
131 | + while (!empty($groups_exceeding_limit)) { |
|
132 | 132 | foreach ($groups_exceeding_limit as $key => $group) { |
133 | 133 | /** @var PaymentOrder[] $group */ |
134 | 134 | //If the group does not exceed the limit, then remove it from the bad list and put it to output array |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $part = array_slice($group, 0, $n + 1); |
147 | 147 | if ($this->calculateSumAmountOfPaymentOrders($part) > $limit_max_amount) { |
148 | 148 | //If our group contains just a single element which exceed the limit, then throw an exception, as we can not split it further. |
149 | - if(count($part) === 1) { |
|
149 | + if (count($part) === 1) { |
|
150 | 150 | throw new SinglePaymentOrderExceedsLimit($part[0], $limit_max_amount); |
151 | 151 | } |
152 | 152 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | //Split group into our two subgroups of which at least one is below the limit |
159 | - $a = array_slice($group, 0 , $split_index); |
|
159 | + $a = array_slice($group, 0, $split_index); |
|
160 | 160 | $b = array_slice($group, $split_index); |
161 | 161 | |
162 | 162 | //Remove the old group from list and add the new split groups |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function sortPaymentOrderArrayByAmount(array $payment_orders, bool $ascending = true): array |
195 | 195 | { |
196 | - usort($payment_orders, function (PaymentOrder $a, PaymentOrder $b) { |
|
196 | + usort($payment_orders, function(PaymentOrder $a, PaymentOrder $b) { |
|
197 | 197 | //When amounts are the same, use the ID to get a consistent sorting |
198 | 198 | if ($a->getAmount() === $b->getAmount()) { |
199 | 199 | return $a->getId() <=> $b->getAmount(); |