Completed
Push — master ( b34763...3537a1 )
by thomas
71:35
created

PaymentHandler::getTransactions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1
Metric Value
dl 0
loc 11
ccs 9
cts 9
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
3
namespace BitWasp\Bitcoin\PaymentProtocol;
4
5
use BitWasp\Bitcoin\PaymentProtocol\Protobufs\Payment;
6
use BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentACK;
7
8
class PaymentHandler
9
{
10
    /**
11
     * @param Payment $payment
12
     * @param string $memo
13
     * @return PaymentACK
14
     */
15
    public function getPaymentAck(Payment $payment, $memo = null)
16
    {
17
        $ack = new PaymentACK();
18
        $ack->setPayment($payment);
19
20
        if (is_string($memo)) {
21
            $ack->setMemo($memo);
22 24
        }
23
24 24
        return $ack;
25 24
    }
26
}
27