Completed
Pull Request — master (#301)
by thomas
69:53
created

PaymentHandler::checkAgainstRequest()   D

Complexity

Conditions 9
Paths 48

Size

Total Lines 39
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 28
CRAP Score 9
Metric Value
dl 0
loc 39
ccs 28
cts 28
cp 1
rs 4.909
cc 9
eloc 24
nc 48
nop 1
crap 9
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