Completed
Pull Request — master (#759)
by thomas
25:10
created

Creator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A createPsbt() 0 13 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Transaction\PSBT;
6
7
use BitWasp\Bitcoin\Transaction\TransactionInterface;
8
9
class Creator
10
{
11 2
    public function createPsbt(TransactionInterface $tx, array $unknowns = []): PSBT
12
    {
13 2
        $nIn = count($tx->getInputs());
14 2
        $inputs = [];
15 2
        for ($i = 0; $i < $nIn; $i++) {
16 2
            $inputs[] = new PSBTInput();
17
        }
18 2
        $nOut = count($tx->getOutputs());
19 2
        $outputs = [];
20 2
        for ($i = 0; $i < $nOut; $i++) {
21 2
            $outputs[] = new PSBTOutput();
22
        }
23 2
        return new PSBT($tx, $unknowns, $inputs, $outputs);
24
    }
25
}
26