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

PaymentHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPaymentAck() 0 11 2
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