Passed
Push — master ( 5c16df...1eb25c )
by Mr
02:34
created

OutputList::getTotal()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 8
ccs 0
cts 5
cp 0
crap 6
rs 10
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