OutputList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTotal() 0 8 2
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the ngutech/bitcoin-interop project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace NGUtech\Bitcoin\ValueObject;
10
11
use Daikon\ValueObject\ValueObjectList;
12
13
/**
14
 * @type(NGUtech\Bitcoin\ValueObject\Output)
15
 */
16
final class OutputList extends ValueObjectList
17
{
18
    public function getTotal(): Bitcoin
19
    {
20
        $value = Bitcoin::zero();
21
        /** @var Output $output */
22
        foreach ($this as $output) {
23
            $value = $value->add($output->getValue());
24
        }
25
        return $value;
26
    }
27
}
28