Completed
Pull Request — master (#301)
by thomas
72:42 queued 01:01
created

PaymentHandler::getPaymentAck()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

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