Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
17 | 28 | public function enforce(Wallet $self, array $transactions): array |
|
18 | { |
||
19 | 28 | $objects = []; |
|
20 | 28 | $amount = 0; |
|
21 | |||
22 | 28 | foreach ($transactions as $transaction) { |
|
23 | 28 | if ($transaction->isConfirmed()) { |
|
24 | 28 | $amount += $transaction->getAmount(); |
|
25 | } |
||
26 | |||
27 | 28 | $objects[] = $transaction->create($self); |
|
28 | } |
||
29 | |||
30 | 28 | $this->addBalance($self, $amount); |
|
31 | 28 | return $objects; |
|
32 | } |
||
62 |