Completed
Push — master ( 5c78d7...6647db )
by thomas
8s
created

AddressNotification::getTxid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace BitWasp\Stratum\Notification;
4
5
use BitWasp\Stratum\Api\ElectrumClient;
6
use BitWasp\Stratum\Request\Request;
7
8
class AddressNotification implements NotificationInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    private $address;
14
15
    /**
16
     * @var string
17
     */
18
    private $txid;
19
20
    /**
21
     * AddressNotification constructor.
22
     * @param string $address
23
     * @param string $txid
24
     */
25 3
    public function __construct($address, $txid)
26
    {
27 3
        $this->address = $address;
28 3
        $this->txid = $txid;
29 3
    }
30
31
    /**
32
     * @return string
33
     */
34 1
    public function getAddress()
35
    {
36 1
        return $this->address;
37
    }
38
39
    /**
40
     * @return string
41
     */
42 1
    public function getTxid()
43
    {
44 1
        return $this->txid;
45
    }
46
47
    /**
48
     * @return Request
49
     */
50 2
    public function toRequest()
51
    {
52 2
        return new Request(null, ElectrumClient::ADDRESS_SUBSCRIBE, [$this->address, $this->txid]);
53
    }
54
}
55