Completed
Push — master ( cc9f4e...3a552b )
by thomas
38:55 queued 36:36
created

CheckerCreatorBase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 41
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
create() 0 1 ?
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Transaction\Factory\Checker;
6
7
use BitWasp\Bitcoin\Crypto\EcAdapter\Adapter\EcAdapterInterface;
8
use BitWasp\Bitcoin\Crypto\EcAdapter\Serializer\Key\PublicKeySerializerInterface;
9
use BitWasp\Bitcoin\Script\Interpreter\CheckerBase;
10
use BitWasp\Bitcoin\Serializer\Signature\TransactionSignatureSerializer;
11
use BitWasp\Bitcoin\Transaction\TransactionInterface;
12
use BitWasp\Bitcoin\Transaction\TransactionOutputInterface;
13
14
abstract class CheckerCreatorBase
15
{
16
    /**
17
     * @var EcAdapterInterface
18
     */
19
    protected $ecAdapter;
20
21
    /**
22
     * @var TransactionSignatureSerializer
23
     */
24
    protected $txSigSerializer;
25
26
    /**
27
     * @var PublicKeySerializerInterface
28
     */
29
    protected $pubKeySerializer;
30
31
    /**
32
     * CheckerCreator constructor.
33
     * @param EcAdapterInterface $ecAdapter
34
     * @param TransactionSignatureSerializer $txSigSerializer
35
     * @param PublicKeySerializerInterface $pubKeySerializer
36
     */
37 109
    public function __construct(
38
        EcAdapterInterface $ecAdapter,
39
        TransactionSignatureSerializer $txSigSerializer,
40
        PublicKeySerializerInterface $pubKeySerializer
41
    ) {
42 109
        $this->ecAdapter = $ecAdapter;
43 109
        $this->txSigSerializer = $txSigSerializer;
44 109
        $this->pubKeySerializer = $pubKeySerializer;
45 109
    }
46
47
    /**
48
     * @param TransactionInterface $tx
49
     * @param int $nInput
50
     * @param TransactionOutputInterface $txOut
51
     * @return CheckerBase
52
     */
53
    abstract public function create(TransactionInterface $tx, int $nInput, TransactionOutputInterface $txOut): CheckerBase;
54
}
55